model

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNameInvalid = errors.New("name is empty")
)
View Source
var (
	ErrNoRow = errors.New("no rows in result set")
)

Functions

func Delete

func Delete(id int) error

Types

type Account

type Account struct {
	ID   int       `json:"id" example:"1" format:"int64"`
	Name string    `json:"name" example:"account name"`
	UUID uuid.UUID `json:"uuid" example:"550e8400-e29b-41d4-a716-446655440000" format:"uuid"`
}

func AccountOne

func AccountOne(id int) (Account, error)

func AccountsAll

func AccountsAll(q string) ([]Account, error)

func (Account) Insert

func (a Account) Insert() (int, error)

func (Account) Update

func (a Account) Update() error

type AddAccount

type AddAccount struct {
	Name string `json:"name" example:"account name"`
}

func (AddAccount) Validation

func (a AddAccount) Validation() error

type Admin

type Admin struct {
	ID   int    `json:"id" example:"1"`
	Name string `json:"name" example:"admin name"`
}

type Bottle

type Bottle struct {
	ID      int     `json:"id" example:"1"`
	Name    string  `json:"name" example:"bottle_name"`
	Account Account `json:"account"`
}

func BottleOne

func BottleOne(id int) (*Bottle, error)

func BottlesAll

func BottlesAll() ([]Bottle, error)

type UpdateAccount

type UpdateAccount struct {
	Name string `json:"name" example:"account name"`
}

func (UpdateAccount) Validation

func (a UpdateAccount) Validation() error

Jump to

Keyboard shortcuts

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