model

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNameInvalid = errors.New("name is empty")
)

example

View Source
var (
	// ErrNoRow example
	ErrNoRow = errors.New("no rows in result set")
)

Functions

func Delete

func Delete(id int) error

Delete example

Types

type Account

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

func AccountOne

func AccountOne(id int) (Account, error)

AccountOne example

func AccountsAll

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

AccountsAll example

func (Account) Insert

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

Insert example

func (Account) Update

func (a Account) Update() error

Update example

type Account2

type Account2 struct {
	ID             int             `json:"id" example:"113" maximum:"195" format:"int64"`
	Name           string          `json:"name" example:"account name"`
	SomeNumber     int             `json:"some_number" example:"1234"`
	CustomVal123   string          `json:"custom_val_123" example:"custom val 123"`
	CustomType4567 []CustomType456 `json:"custom_type_4567" description:"custom type 4567 description"` // zzz
	UUID           uuid.UUID       `json:"uuid" example:"550e8400-e29b-41d4-a716-446655440000" format:"uuid"`
}

Account example

type AddAccount

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

AddAccount example

func (AddAccount) Validation

func (a AddAccount) Validation() error

Validation example

type Admin

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

Admin example

type Bottle

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

Bottle example

func BottleOne

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

BottleOne example

func BottlesAll

func BottlesAll() ([]Bottle, error)

BottlesAll example

type CustomType456

type CustomType456 struct {
	ZZ    int    `json:"zz" example:"34"`
	ZZStr string `json:"zzStr" example:"zz string value"`
}

type Message

type Message struct {
	Message string `json:"message" example:"message"`
}

Message example

type UpdateAccount

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

UpdateAccount example

func (UpdateAccount) Validation

func (a UpdateAccount) Validation() error

Validation example

Jump to

Keyboard shortcuts

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