Documentation ¶
Index ¶
- Variables
- func DBCreate[T any](one *T) (*T, error)
- func DBDelete[T any](id uint) (err error)
- func DBExists[T any](where map[any]any) (bool, error)
- func DBFind[T any](where map[any]any) (data []*T, err error)
- func DBFindByID[T any](id uint) (*T, error)
- func DBFindOne[T any](where map[any]any) (*T, error)
- func DBFindOneAndDelete[T any](where map[any]any) (*T, error)
- func DBFindOneAndUpdate[T any](where map[any]any, callback func(*T)) (*T, error)
- func DBFindOneByIDAndDelete[T any](id uint) (*T, error)
- func DBFindOneByIDAndUpdate[T any](id uint, callback func(*T)) (*T, error)
- func DBFindOneByIDOrCreate[T any](id uint, callback func(*T)) (*T, error)
- func DBFindOneOrCreate[T any](where map[any]any, callback func(*T)) (*T, error)
- func DBGetMany[T any](ids []uint) (data []*T, err error)
- func DBGetOrCreate[T any](where map[any]any, callback func(*T)) (*T, error)
- func DBHas[T any](id uint) bool
- func DBList[T any](page, pageSize uint, where *Where, orderBy *OrderBy) (data []*T, total int64, err error)
- func DBListAll[T any](where *Where, orderBy *OrderBy) (data []*T, err error)
- func DBRetrieve[T any](id uint) (*T, error)
- func DBSave[T any](one *T) error
- func DBUpdate[T any](id uint, uc func(*T)) (err error)
- func GetController[T any](id string) T
- func GetDB() *gorm.DB
- func GetModel[T any](id string) T
- func GetService[T any](id string) T
- func LoadDB(engine string, dsn string, opts ...*LoadDBOptions) (err error)
- func Register(namespace string, model Model, service Service, controller Controller)
- func RegisterController(name string, m Controller)
- func RegisterModel(name string, m Model)
- func RegisterService(name string, m Service)
- type Controller
- type ControllerImpl
- func (c *ControllerImpl) FailWithError(ctx *zoox.Context, err zoox.HTTPError)
- func (c *ControllerImpl) Params(ctx *zoox.Context) *Params
- func (c *ControllerImpl) Service() container.Container
- func (c *ControllerImpl) Success(ctx *zoox.Context, data interface{})
- func (c *ControllerImpl) User(ctx *zoox.Context) interface{}
- type ListParams
- type ListParamsDefault
- type LoadDBOptions
- type Model
- type ModelImpl
- type OrderBy
- type OrderByOne
- type Page
- type Params
- type Service
- type ServiceImpl
- type SetWhereOptions
- type Where
- type WhereOne
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "1.2.5"
Version is the version of this package.
Functions ¶
func DBFindByID ¶ added in v1.0.2
func DBFindOneAndDelete ¶ added in v1.0.2
func DBFindOneAndUpdate ¶ added in v1.0.1
func DBFindOneByIDAndDelete ¶ added in v1.0.2
func DBFindOneByIDAndUpdate ¶ added in v1.0.2
func DBFindOneByIDOrCreate ¶ added in v1.0.2
func DBFindOneOrCreate ¶ added in v1.0.2
func DBGetOrCreate ¶ added in v1.0.1
func DBRetrieve ¶
func GetController ¶
func GetService ¶
func Register ¶
func Register(namespace string, model Model, service Service, controller Controller)
func RegisterController ¶
func RegisterController(name string, m Controller)
func RegisterModel ¶
func RegisterService ¶
Types ¶
type Controller ¶
type ControllerImpl ¶
type ControllerImpl struct { }
func (*ControllerImpl) FailWithError ¶
func (c *ControllerImpl) FailWithError(ctx *zoox.Context, err zoox.HTTPError)
func (*ControllerImpl) Service ¶
func (c *ControllerImpl) Service() container.Container
func (*ControllerImpl) Success ¶
func (c *ControllerImpl) Success(ctx *zoox.Context, data interface{})
func (*ControllerImpl) User ¶
func (c *ControllerImpl) User(ctx *zoox.Context) interface{}
type ListParamsDefault ¶ added in v1.0.6
type LoadDBOptions ¶ added in v1.2.4
type LoadDBOptions struct {
IsProd bool
}
type ModelImpl ¶
type OrderBy ¶
type OrderBy []OrderByOne
type OrderByOne ¶
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
func (*Params) GetList ¶
func (c *Params) GetList(defaults ...*ListParamsDefault) (*ListParams, error)
type ServiceImpl ¶
type ServiceImpl struct { }
func (*ServiceImpl) Model ¶
func (s *ServiceImpl) Model() container.Container
func (*ServiceImpl) Name ¶
func (s *ServiceImpl) Name() string
func (*ServiceImpl) Service ¶
func (s *ServiceImpl) Service() container.Container
type SetWhereOptions ¶
Click to show internal directories.
Click to hide internal directories.