diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-03-15 13:24:25 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-03-15 13:24:25 -0700 |
commit | 95c7e73e2b8acf048ba61b3feab76dd5f46ac955 (patch) | |
tree | 54b025fc6ae9eb7d1adea71f33ec6d05ae50b3db /examples/externalable/README.md | |
parent | 40a7be1cb8218e705d77965f61c2c948e23971b9 (diff) |
adding deleteable example, rename and modify externalable -> createable
Diffstat (limited to 'examples/externalable/README.md')
-rw-r--r-- | examples/externalable/README.md | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/examples/externalable/README.md b/examples/externalable/README.md deleted file mode 100644 index 025e7fb..0000000 --- a/examples/externalable/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Externalable - -This example shows how to enable outside clients to submit 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/external?type=<Type>` - -## 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: -```go -type Song struct { - item.Item - - Title string `json:"title"` - Artist string `json:"artist"` - Rating int `json:"rating"` - Opinion string `json:"opinion"` - SpotifyURL string `json:"spotify_url"` -} -``` - -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.Externalable` with the `Accept(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 - -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 |