Documentation ¶
Index ¶
- func NewDBClient(configPath string) *gorm.DB
- func ToGormScopes(scopes []Scope) []func(db *gorm.DB) *gorm.DB
- func ToMap(maps []Map) map[string]interface{}
- type BaseRepo
- func (b *BaseRepo[T]) Create(ctx context.Context, t *T, tx ...*gorm.DB) error
- func (b *BaseRepo[T]) GetByScopes(ctx context.Context, scopes []Scope, tx ...*gorm.DB) (*T, error)
- func (b *BaseRepo[T]) GetCountByScopes(ctx context.Context, scopes []Scope, tx ...*gorm.DB) (int64, error)
- func (b *BaseRepo[T]) GetListByScopes(ctx context.Context, scopes []Scope, tx ...*gorm.DB) ([]*T, error)
- func (b *BaseRepo[T]) MapExprAdd(k string, v interface{}) Map
- func (b *BaseRepo[T]) MapExprSub(k string, v interface{}) Map
- func (b *BaseRepo[T]) MapKV(k string, v interface{}) Map
- func (b *BaseRepo[T]) SaveByScopes(ctx context.Context, t *T, scopes []Scope, tx ...*gorm.DB) error
- func (b *BaseRepo[T]) ScopeBetween(k string, v1, v2 interface{}) Scope
- func (b *BaseRepo[T]) ScopeEqual(k string, v interface{}) Scope
- func (b *BaseRepo[T]) ScopeGT(k string, v interface{}) Scope
- func (b *BaseRepo[T]) ScopeGTE(k string, v interface{}) Scope
- func (b *BaseRepo[T]) ScopeIN(k string, v interface{}) Scope
- func (b *BaseRepo[T]) ScopeLT(k string, v interface{}) Scope
- func (b *BaseRepo[T]) ScopeLTE(k string, v interface{}) Scope
- func (b *BaseRepo[T]) ScopeLike(k string, v interface{}) Scope
- func (b *BaseRepo[T]) ScopeLimit(v interface{}) Scope
- func (b *BaseRepo[T]) ScopeNotEqual(k string, v interface{}) Scope
- func (b *BaseRepo[T]) ScopeOffset(v interface{}) Scope
- func (b *BaseRepo[T]) ScopeOrderBy(v string) Scope
- func (b *BaseRepo[T]) Transaction(f func(tx *gorm.DB) error) error
- func (b *BaseRepo[T]) UpdateByScopesAndMaps(ctx context.Context, scopes []Scope, maps []Map, tx ...*gorm.DB) error
- type ICreator
- type IGetter
- type ITx
- type IUpdater
- type Map
- type Scope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseRepo ¶
type BaseRepo[T any] struct { // contains filtered or unexported fields }
func NewBaseRepo ¶
NewBaseRepo ...
func (*BaseRepo[T]) GetByScopes ¶
GetByScopes ...
func (*BaseRepo[T]) GetCountByScopes ¶
func (b *BaseRepo[T]) GetCountByScopes(ctx context.Context, scopes []Scope, tx ...*gorm.DB) (int64, error)
GetCountByScopes ...
func (*BaseRepo[T]) GetListByScopes ¶
func (b *BaseRepo[T]) GetListByScopes(ctx context.Context, scopes []Scope, tx ...*gorm.DB) ([]*T, error)
GetListByScopes ...
func (*BaseRepo[T]) MapExprAdd ¶
MapExprAdd ...
func (*BaseRepo[T]) MapExprSub ¶
MapExprSub ...
func (*BaseRepo[T]) SaveByScopes ¶
SaveByScopes ...
func (*BaseRepo[T]) ScopeBetween ¶
ScopeBetween ...
func (*BaseRepo[T]) ScopeEqual ¶
ScopeEqual ...
func (*BaseRepo[T]) ScopeLimit ¶
ScopeLimit ...
func (*BaseRepo[T]) ScopeNotEqual ¶
ScopeNotEqual ...
func (*BaseRepo[T]) ScopeOffset ¶
ScopeOffset ...
func (*BaseRepo[T]) ScopeOrderBy ¶
ScopeOrderBy ...
func (*BaseRepo[T]) Transaction ¶
Transaction ...
Click to show internal directories.
Click to hide internal directories.