model

package
v0.0.0-...-a9b7109 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAll

func FindAll[C Crud](model Crud, dao *daos.Dao, authRecord *models.Record) ([]C, error)

func FindById

func FindById(model Crud, dao *daos.Dao, authRecord *models.Record, id string) error

func Save

func Save(model Crud, dao *daos.Dao) error

Types

type Crud

type Crud interface {
	models.Model
	GetUser() string
	Validate() error
}

type Todo

type Todo struct {
	models.BaseModel
	User string `db:"user" json:"user"`
	Name string `db:"name" json:"name"`
}

func (*Todo) Delete

func (todo *Todo) Delete(dao *daos.Dao) error

func (*Todo) FindAll

func (todo *Todo) FindAll(dao *daos.Dao, authRecord *models.Record) ([]*Todo, error)

func (*Todo) FindById

func (todo *Todo) FindById(dao *daos.Dao, authRecord *models.Record, id string) error

func (*Todo) GetUser

func (todo *Todo) GetUser() string

func (*Todo) Save

func (todo *Todo) Save(dao *daos.Dao) error

func (*Todo) TableName

func (*Todo) TableName() string

func (*Todo) Validate

func (todo *Todo) Validate() error

Jump to

Keyboard shortcuts

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