models

package
v0.0.0-...-f7ca523 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2017 License: MIT Imports: 10 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyTaken = errors.New("is already taken")
)

Functions

This section is empty.

Types

type AdminUser

type AdminUser struct {
	ID           int64
	Name         nulls.String      `db:"name"`
	Email        nulls.String      `db:"email"`
	PasswordHash nulls.String      `db:"password_hash"`
	InsertedAt   time.Time         `db:"inserted_at"`
	UpdatedAt    time.Time         `db:"updated_at"`
	Password     string            `db:"-"`
	Errors       map[string]string `db:"-"`
}

func GetAdminByEmail

func GetAdminByEmail(email string) (*AdminUser, error)

func GetAdminUser

func GetAdminUser(id int64) (*AdminUser, error)

func NewAdminUser

func NewAdminUser(name, email, password string) *AdminUser

func (*AdminUser) CheckAuth

func (u *AdminUser) CheckAuth(password string) bool

func (*AdminUser) Create

func (u *AdminUser) Create() error

func (*AdminUser) Validate

func (u *AdminUser) Validate() bool

type Page

type Page struct {
	ID              int64
	Title           nulls.String      `db:"title"`
	PageTitle       nulls.String      `db:"page_title"`
	MetaDescription nulls.String      `db:"meta_description"`
	Content         nulls.String      `db:"content"`
	Slug            nulls.String      `db:"slug"`
	Layout          nulls.String      `db:"layout"`
	InsertedAt      time.Time         `db:"inserted_at"`
	UpdatedAt       time.Time         `db:"updated_at"`
	Errors          map[string]string `db:"-"`
}

func GetPage

func GetPage(ID int) (*Page, error)

func GetPageBySlug

func GetPageBySlug(slug string) (*Page, error)

func ListAllPages

func ListAllPages() ([]*Page, error)

func ListPages

func ListPages(offset, limit int) ([]*Page, int, error)

func NewPage

func NewPage() *Page

func (*Page) Create

func (p *Page) Create() error

func (*Page) Delete

func (p *Page) Delete() error

func (*Page) Update

func (p *Page) Update() error

func (*Page) Validate

func (p *Page) Validate() bool

type SupportMessage

type SupportMessage struct {
	ID         int64
	Name       nulls.String      `db:"name"`
	Email      nulls.String      `db:"email"`
	Subject    nulls.String      `db:"subject"`
	Content    nulls.String      `db:"content"`
	InsertedAt time.Time         `db:"inserted_at"`
	UpdatedAt  time.Time         `db:"updated_at"`
	Errors     map[string]string `db:"-"`
}

func ListMessages

func ListMessages(offset, limit int) ([]*SupportMessage, int, error)

func (*SupportMessage) Create

func (m *SupportMessage) Create() error

func (*SupportMessage) Delete

func (b *SupportMessage) Delete() error

func (*SupportMessage) Validate

func (m *SupportMessage) Validate() bool

Jump to

Keyboard shortcuts

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