diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-03-15 14:53:25 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-03-15 14:53:25 -0700 |
commit | 709fdc6ce0184034dfe2df7c413772c19a4455f0 (patch) | |
tree | 5ae229e58f2e26df3c8a320e3354f037c1cf15d1 /examples | |
parent | dc273a62f38da6962be1edd3d54df48245a6d088 (diff) |
updating examples with deleteable
Diffstat (limited to 'examples')
-rw-r--r-- | examples/README.md | 4 | ||||
-rw-r--r-- | examples/createable/README.md | 6 | ||||
-rw-r--r-- | examples/deleteable/README.md | 14 | ||||
-rw-r--r-- | examples/updateable/README.md | 4 |
4 files changed, 14 insertions, 14 deletions
diff --git a/examples/README.md b/examples/README.md index cd070b1..4e62bf8 100644 --- a/examples/README.md +++ b/examples/README.md @@ -10,6 +10,6 @@ feature, it would be very helpful to include an example with a concrete use-case for this directory. ### Table of Contents -1. [Add content via HTTP API using the `api.Createable` interface](https://github.com/ponzu-cms/ponzu/tree/master/examples/createable) +1. [Create content via HTTP API using the `api.Createable` interface](https://github.com/ponzu-cms/ponzu/tree/master/examples/createable) 2. [Update content via HTTP API using the `api.Updateable` interface](https://github.com/ponzu-cms/ponzu/tree/master/examples/updateable) - +3. [Delete content via HTTP API using the `api.Deleteable` interface](https://github.com/ponzu-cms/ponzu/tree/master/examples/deleteable) diff --git a/examples/createable/README.md b/examples/createable/README.md index 44ba03c..72801f8 100644 --- a/examples/createable/README.md +++ b/examples/createable/README.md @@ -23,9 +23,9 @@ See the file `content/song.go` and read the comments to understand the various methods needed to satisfy required interfaces for this kind of activity. ### Overview -1. Implement `api.Createable` with the `Create(http.ResponseWriter, *http.Request)` method to allow outside POST requests -2. Implement `editor.Mergeable` with the `Approve(http.ResponseWriter, *http.Request)` method so you can control the Approval / Rejection of submitted content OR -3. Implement `api.Trustable` with the `AutoApprove(http.ResponseWriter, *http.Request)` method to bypass `Approve` and auto-approve and publish submitted content +1. Implement `api.Createable` with the `Create(http.ResponseWriter, *http.Request) error` method to allow outside POST requests +2. Implement `editor.Mergeable` with the `Approve(http.ResponseWriter, *http.Request) error` method so you can control the Approval / Rejection of submitted content OR +3. Implement `api.Trustable` with the `AutoApprove(http.ResponseWriter, *http.Request) error` method to bypass `Approve` and auto-approve and publish submitted content There are various validation and request checks shown in this example as well. Please feel free to modify and submit a PR for updates or bug fixes!
\ No newline at end of file diff --git a/examples/deleteable/README.md b/examples/deleteable/README.md index 06f4188..b990a82 100644 --- a/examples/deleteable/README.md +++ b/examples/deleteable/README.md @@ -1,12 +1,12 @@ -# Updateable +# Deleteable -This example shows how to enable outside clients to update content to your CMS. -All content submitted must be done through a POST request encoded as `multipart/form-data` -to the API endpoint `/api/content/update?type=<Type>&id=<id>` +This example shows how to enable outside clients to delete content from your CMS. +All content deletes must be done through a POST request encoded as `multipart/form-data` +to the API endpoint `/api/content/delete?type=<Type>&id=<id>` ## Song example Imagine an app that lets users add Spotify music to a global playlist, and you need them -to supply songs in the format: +to supply or remove songs which are in the format: ```go type Song struct { item.Item @@ -23,8 +23,8 @@ See the file `content/song.go` and read the comments to understand the various methods needed to satisfy required interfaces for this kind of activity. ### Overview -1. Implement `api.Updateable` with the `Update(http.ResponseWriter, *http.Request)` method to allow outside POST requests. -2. Consistent with the createable example, authentication can be validated in `BeforeAPIUpdate(http.ResponseWriter, *http.Request)` +1. Implement `api.Deleteable` with the `Delete(http.ResponseWriter, *http.Request)` method to allow outside POST requests. +2. Consistent with the createable example, authentication can be validated in `BeforeAPIDelete(http.ResponseWriter, *http.Request) error` There are various validation and request checks shown in this example as well. Please feel free to modify and submit a PR for updates or bug fixes! diff --git a/examples/updateable/README.md b/examples/updateable/README.md index 06f4188..280cc46 100644 --- a/examples/updateable/README.md +++ b/examples/updateable/README.md @@ -23,8 +23,8 @@ See the file `content/song.go` and read the comments to understand the various methods needed to satisfy required interfaces for this kind of activity. ### Overview -1. Implement `api.Updateable` with the `Update(http.ResponseWriter, *http.Request)` method to allow outside POST requests. -2. Consistent with the createable example, authentication can be validated in `BeforeAPIUpdate(http.ResponseWriter, *http.Request)` +1. Implement `api.Updateable` with the `Update(http.ResponseWriter, *http.Request) error` method to allow outside POST requests. +2. Consistent with the createable example, authentication can be validated in `BeforeAPIUpdate(http.ResponseWriter, *http.Request) error` There are various validation and request checks shown in this example as well. Please feel free to modify and submit a PR for updates or bug fixes! |