Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
*revel.Controller
}
func (Base) RenderContent ¶
renderContent runs through a switch case to parse and return the content format filled in with the desired data. Parameter @cnt is a map[string]map[string]interface{} which will get parsed into the desired response. Param @resType is a string that tells us what type of response format that we need. @todo may need to refactor this out as response format types get larger and move to a more polymorphic approach instead of a switch case @todo need to add more response formats.
Available resFormats at the moment: json, xml
type Delete ¶
type Delete struct { *revel.Controller Base }
func (Delete) DeleteCollectionResource ¶
type Get ¶
type Get struct { *revel.Controller Base }
func (Get) GetResource ¶
GetResource returns a valid kekdoc, kekcollection or kekmedia item according to the resource string. The resource string can be the id of the resource item or a slug representing collections. Slugs aren't guaranteed unique and you could have numerous collections having the same slug.
type Options ¶
type Options struct { *revel.Controller Base }
type Patch ¶
type Patch struct { *revel.Controller Base }
func (Patch) PatchResource ¶
Patch handles an HTTP Patch request method. It will patch a resource item for an individual content type if the request matches the appropriate authorization and access. @param resource is a string that tells us the resource identifier that we are patching. Patch will return back a success method with data on success. It will return an appropriate HTTP error code and message on failuare. TODO(miracle) Patch should follow some standard that also has description. Needs more research to determine how to handle standardization without overcomplicating it. TODO(miracle) Patching collections should be dynamic enough to know based on the id whether its a collection. Also, if it is a slug then we know its a collection.
type Post ¶
type Post struct { *revel.Controller Base }
func (Post) PostCollectionResource ¶
func (Post) PostResource ¶
PostResource handles an HTTP POST request from the server by creating a brand new content resource. The @contentType parameter tells us the type of content that we are creating. It returns back a json array with a succes message and the data when a new item is created. It will return an appropriate error code and message when the user either didn't have enough access or the system couldn't create the new content resource.