Documentation
¶
Overview ¶
Package posts represents the post resource
Index ¶
Constants ¶
View Source
const ( // TableName is the database table for this resource TableName = "posts" // KeyName is the primary key value for this resource KeyName = "id" // Order defines the default sort order in sql for this resource Order = "name asc, id desc" )
Variables ¶
This section is empty.
Functions ¶
func AllowedParams ¶
func AllowedParams() []string
AllowedParams returns an array of allowed param keys for Update and Create.
Types ¶
type Post ¶
type Post struct {
// resource.Base defines behaviour and fields shared between all resources
resource.Base
// status.ResourceStatus defines a status field and associated behaviour
status.ResourceStatus
AuthorID int64
Keywords string
Name string
Summary string
Template string
Text string
}
Post handles saving and retreiving posts from the database
func FindFirst ¶
FindFirst fetches a single post record from the database using a where query with the format and args provided.
func NewWithColumns ¶
NewWithColumns creates a new post instance and fills it with data from the database cols provided.
func (*Post) ShowTemplate ¶
ShowTemplate returns the default template if none is set, or the template selected
func (*Post) TemplateOptions ¶
func (p *Post) TemplateOptions() []helpers.Selectable
TemplateOptions provides a set of options for the templates menu ids are indexes into the templates array above
Click to show internal directories.
Click to hide internal directories.