Documentation
¶
Index ¶
- func FindOne[TDb any, TDomain any](ctx context.Context, queryBuilder QueryOneBuilder[TDb], ...) (*TDomain, error)
- func InitSubModule(params InitParams) error
- func List[TDb any, TDomain any, TQuery interface{ ... }](ctx context.Context, query TQuery, convertFn func([]*TDb) []TDomain) ([]TDomain, error)
- func Mutate[TDb any, TDomain any](ctx context.Context, mutationBuilder MutationBuilder[TDb], ...) (*TDomain, error)
- func MutateBulk[TDb any, TDomain any](ctx context.Context, mutationBuilder MutationBulkBuilder[TDb], ...) ([]TDomain, error)
- func ParseSearchGraph[TDb any, TDomain any](criteria *orm.SearchGraph, entityName string) (*orm.Predicate, []orm.OrderOption, ft.ValidationErrors)
- func ParseSearchGraphStr[TDb any, TDomain any](criteria *string, entityName string) (*orm.Predicate, []orm.OrderOption, ft.ValidationErrors)
- type DbLock
- type DbTransaction
- type EntClientOptions
- type EntRepositoryBase
- type EntToDomainArrFn
- type EntToDomainFn
- type InitParams
- type MutationBuilder
- type MutationBulkBuilder
- type PagedResult
- type PagingOptions
- type QueryOneBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindOne ¶
func FindOne[TDb any, TDomain any]( ctx context.Context, queryBuilder QueryOneBuilder[TDb], isNotFoundFn func(err error) bool, convertFn EntToDomainFn[TDb, TDomain], ) (*TDomain, error)
func InitSubModule ¶
func InitSubModule(params InitParams) error
func Mutate ¶
func Mutate[TDb any, TDomain any]( ctx context.Context, mutationBuilder MutationBuilder[TDb], isNotFoundFn func(err error) bool, convertFn EntToDomainFn[TDb, TDomain], ) (*TDomain, error)
func MutateBulk ¶
func MutateBulk[TDb any, TDomain any]( ctx context.Context, mutationBuilder MutationBulkBuilder[TDb], isNotFoundFn func(err error) bool, convertFn EntToDomainArrFn[TDb, TDomain], ) ([]TDomain, error)
func ParseSearchGraph ¶
func ParseSearchGraph[TDb any, TDomain any](criteria *orm.SearchGraph, entityName string) (*orm.Predicate, []orm.OrderOption, ft.ValidationErrors)
func ParseSearchGraphStr ¶
func ParseSearchGraphStr[TDb any, TDomain any](criteria *string, entityName string) (*orm.Predicate, []orm.OrderOption, ft.ValidationErrors)
Types ¶
type DbLock ¶
type DbLock struct {
Tranx DbTransaction
}
func FindOneForUpdate ¶
func FindOneForUpdate[TDb any, TDomain any, TQuery interface { Only(context.Context) (*TDb, error) ForUpdate(opts ...sql.LockOption) TQuery }]( ctx context.Context, queryBuilder TQuery, isNotFoundFn func(err error) bool, convertFn EntToDomainFn[TDb, TDomain], tranx DbTransaction, ) (*TDomain, *DbLock, error)
type DbTransaction ¶
type EntClientOptions ¶
type EntRepositoryBase ¶
type EntRepositoryBase struct {
}
type EntToDomainArrFn ¶
type EntToDomainFn ¶
type InitParams ¶
type InitParams struct {
dig.In
Config config.ConfigService
Logger logging.LoggerService
}
type MutationBuilder ¶
type MutationBulkBuilder ¶
type PagedResult ¶
type PagedResult[T any] struct { Items []T `json:"items"` Total int `json:"total"` Page int `json:"page"` Size int `json:"size"` }
func Search ¶
func Search[TDb any, TDomain any, TQuery interface { Where(...orm.Predicate) TQuery Clone() TQuery Count(context.Context) (int, error) Offset(int) TQuery Limit(int) TQuery Order(...orm.OrderOption) TQuery All(context.Context) ([]*TDb, error) }]( ctx context.Context, predicate *orm.Predicate, order []orm.OrderOption, opts PagingOptions, query TQuery, convertFn func([]*TDb) []TDomain, ) (*PagedResult[TDomain], error)
type PagingOptions ¶
Click to show internal directories.
Click to hide internal directories.