pages

package
v0.0.0-...-22be18f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowedParams

func AllowedParams() []string

AllowedParams returns an array of allowed param keys

func Create

func Create(params map[string]string) (int64, error)

Create inserts a new record in the database using params, and returns the newly created id

func Published

func Published() *query.Query

Published returns a query for all pages with status >= published

func Query

func Query() *query.Query

Query returns a new query for pages

func Where

func Where(format string, args ...interface{}) *query.Query

Where returns a Where query for pages with the arguments supplied

Types

type Page

type Page struct {
	model.Model
	status.ModelStatus
	Keywords string
	Name     string
	Summary  string
	URL      string
	Text     string
}

Page handles saving and retreiving pages from the database

func Find

func Find(id int64) (*Page, error)

Find returns a single record by id in params

func FindAll

func FindAll(q *query.Query) ([]*Page, error)

FindAll returns all results for this query

func New

func New() *Page

New creates and initialises a new page instance

func NewWithColumns

func NewWithColumns(cols map[string]interface{}) *Page

NewWithColumns creates a new page instance and fills it with data from the database cols provided

func (*Page) Destroy

func (m *Page) Destroy() error

Destroy removes the record from the database

func (*Page) Update

func (m *Page) Update(params map[string]string) error

Update sets the record in the database from params

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL