Documentation ¶
Index ¶
- func EnoughTime(key string, cb func(key string) error) bool
- type Item
- func (i *Item) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterAPIDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterAPIResponse(res http.ResponseWriter, req *http.Request, data []byte) error
- func (i *Item) AfterAPIUpdate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterAdminCreate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterAdminDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterAdminUpdate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterApprove(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterDisable(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterEnable(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterReject(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterSave(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAPIDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAPIResponse(res http.ResponseWriter, req *http.Request, data []byte) ([]byte, error)
- func (i *Item) BeforeAPIUpdate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAdminCreate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAdminDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAdminUpdate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeApprove(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeDisable(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeEnable(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeReject(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeSave(res http.ResponseWriter, req *http.Request) error
- func (i *Item) IndexContent() bool
- func (i *Item) ItemID() int
- func (i *Item) ItemName() string
- func (i *Item) ItemSlug() string
- func (i *Item) ItemStatus() content.Status
- func (i *Item) SearchMapping() (*mapping.IndexMappingImpl, error)
- func (i *Item) SetItemID(id int)
- func (i *Item) SetItemStatus(status content.Status)
- func (i *Item) SetSlug(slug string)
- func (i *Item) SetUniqueID(uuid uuid.UUID)
- func (i *Item) String() string
- func (i *Item) Time() int64
- func (i *Item) Touch() int64
- func (i *Item) UniqueID() uuid.UUID
- type Song
- func (s *Song) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Song) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *Song) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *Song) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Song) Create(res http.ResponseWriter, req *http.Request) error
- func (s *Song) IndexContent() bool
- func (s *Song) MarshalEditor() ([]byte, error)
- func (s *Song) Push(http.ResponseWriter, *http.Request) ([]string, error)
- func (s *Song) String() string
- type SortableContent
- type Student
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Item ¶
type Item struct { UUID uuid.UUID `json:"uuid"` Status content.Status `json:"status"` Namespace string `json:"namespace"` ID int `json:"id"` Slug string `json:"slug"` Timestamp int64 `json:"timestamp"` Updated int64 `json:"updated"` }
Item should only be embedded into content type structs.
func (*Item) AfterAPICreate ¶
AfterAPICreate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAPIDelete ¶
AfterAPIDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAPIResponse ¶
AfterAPIResponse is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAPIUpdate ¶
AfterAPIUpdate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAdminCreate ¶
AfterAdminCreate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAdminDelete ¶
AfterAdminDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAdminUpdate ¶
AfterAdminUpdate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterApprove ¶
AfterApprove is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterDelete ¶
AfterDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterDisable ¶
AfterDisable is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterEnable ¶
AfterEnable is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterReject ¶
AfterReject is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterSave ¶
AfterSave is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAPICreate ¶
BeforeAPICreate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAPIDelete ¶
BeforeAPIDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAPIResponse ¶
func (i *Item) BeforeAPIResponse(res http.ResponseWriter, req *http.Request, data []byte) ([]byte, error)
BeforeAPIResponse is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAPIUpdate ¶
BeforeAPIUpdate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAdminCreate ¶
BeforeAdminCreate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAdminDelete ¶
BeforeAdminDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAdminUpdate ¶
BeforeAdminUpdate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeApprove ¶
BeforeApprove is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeDelete ¶
BeforeDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeDisable ¶
BeforeDisable is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeEnable ¶
BeforeEnable is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeReject ¶
BeforeReject is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeSave ¶
BeforeSave is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) IndexContent ¶
IndexContent determines if a type should be indexed for searching partially implements search.Searchable
func (*Item) ItemID ¶
ItemID gets the *Item's ID field partially implements the Identifiable interface
func (*Item) ItemName ¶
ItemName gets the *Item's Namespace field partially implements the Identifiable interface
func (*Item) ItemStatus ¶
ItemStatus gets the *Item's Status field partially implements the Identifiable interface
func (*Item) SearchMapping ¶
func (i *Item) SearchMapping() (*mapping.IndexMappingImpl, error)
SearchMapping returns a default implementation of a Bleve IndexMappingImpl partially implements search.Searchable
func (*Item) SetItemID ¶
SetItemID sets the *Item's ID field partially implements the Identifiable interface
func (*Item) SetItemStatus ¶
SetItemStatus sets the *Item's Status field partially implements the Identifiable interface
func (*Item) SetUniqueID ¶
type Song ¶
type Song struct { Item Student string `json:"student"` Title string `json:"title"` Artist string `json:"artist"` Rating int `json:"rating"` Opinion string `json:"opinion"` SpotifyURL string `json:"spotify_url"` Assets string `json:"assets"` }
func (*Song) AfterAPICreate ¶
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*Song) Approve ¶
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*Song) AutoApprove ¶
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*Song) BeforeAPICreate ¶
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*Song) Create ¶
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*Song) IndexContent ¶
func (*Song) MarshalEditor ¶
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
type SortableContent ¶
func (SortableContent) Len ¶
func (s SortableContent) Len() int
func (SortableContent) Less ¶
func (s SortableContent) Less(i, j int) bool
func (SortableContent) Swap ¶
func (s SortableContent) Swap(i, j int)
type Student ¶
func (*Student) MarshalEditor ¶
MarshalEditor writes a buffer of html to edit a Artist within the CMS and implements editor.Editable