Documentation
¶
Index ¶
- Constants
- func CtxWithTxo(parent context.Context) context.Context
- func ErrCtx(ctx context.Context) error
- func SetErrCtx(ctx context.Context, err error) error
- func SetTxCtx(ctx context.Context, tx sq.BaseRunner) error
- func TxCtx(ctx context.Context, t sq.BaseRunner) sq.BaseRunner
- type CacheStore
- type FindOption
- type OrderBy
- type Txo
- type WhereCondition
Constants ¶
View Source
const ( // TxoKey is key for Txo TxoKey key = iota )
Variables ¶
This section is empty.
Functions ¶
func CtxWithTxo ¶
CtxWithTxo return context with txo
func SetTxCtx ¶
func SetTxCtx(ctx context.Context, tx sq.BaseRunner) error
SetTxCtx to set tx in ctx
func TxCtx ¶
func TxCtx(ctx context.Context, t sq.BaseRunner) sq.BaseRunner
TxCtx return transaction from context if any or return t params
Types ¶
type CacheStore ¶ added in v0.8.20
CacheStore responsible to cache data
func NewCacheStore ¶ added in v0.8.20
func NewCacheStore(client *redis.Client) *CacheStore
NewCacheStore return new instance of CacheStore
func (*CacheStore) Retrieve ¶ added in v0.8.20
func (c *CacheStore) Retrieve(ctx context.Context, key string, target interface{}, refresh func() (interface{}, error)) (err error)
Retrieve cache data
func (*CacheStore) WithExpiration ¶ added in v0.8.20
func (c *CacheStore) WithExpiration(expiration time.Duration) *CacheStore
WithExpiration return cache store with new expiration
type FindOption ¶ added in v0.8.19
type FindOption interface {
CompileQuery(sq.SelectBuilder) (sq.SelectBuilder, error)
String() string
}
FindOption to compile find query
func Pagination ¶ added in v0.8.19
func Pagination(offset, limit uint64) FindOption
Pagination find option
func PaginationWithRange ¶ added in v0.8.19
func PaginationWithRange(start, end uint64) FindOption
PaginationWithRange to setup pagination with start and end index
func Sort ¶ added in v0.8.19
func Sort(column string, orderBy OrderBy) FindOption
Sort is find option to sort by column and order
type Txo ¶
type Txo struct {
// contains filtered or unexported fields
}
Txo stand of transaction object
type WhereCondition ¶ added in v0.8.19
type WhereCondition FindOption
WhereCondition is find option with WHERE condition
func Equal ¶ added in v0.8.19
func Equal(column string, cond string) WhereCondition
Equal where condition
func Like ¶ added in v0.8.19
func Like(column, condition string) WhereCondition
Like where condition
Click to show internal directories.
Click to hide internal directories.