model

package
v0.0.0-...-889cdc1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNameInvalid example
	ErrNameInvalid = errors.New("name is empty")
)
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"`
	UUID uuid.UUID `json:"uuid" example:"550e8400-e29b-41d4-a716-446655440000" format:"uuid"`
}

Account example

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 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 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