Documentation ¶
Index ¶
- Constants
- func DisableCacheHashCheck()
- func SetUUIDServerID(id uint16)
- type Alter
- type BackgroundConsumer
- func (r *BackgroundConsumer) Digest(ctx context.Context) bool
- func (b *BackgroundConsumer) DisableBlockMode()
- func (r *BackgroundConsumer) GetLazyFlushEventsSample(count int64) []string
- func (r *BackgroundConsumer) RegisterLazyFlushQueryErrorResolver(resolver LazyFlushQueryErrorResolver)
- func (r *BackgroundConsumer) SetBlockTime(ttl time.Duration)
- type Bind
- type CachedQuery
- type DB
- func (db *DB) Begin()
- func (db *DB) Commit()
- func (db *DB) Exec(query string, args ...interface{}) ExecResult
- func (db *DB) GetPoolConfig() MySQLPoolConfig
- func (db *DB) IsInTransaction() bool
- func (db *DB) Query(query string, args ...interface{}) (rows Rows, close func())
- func (db *DB) QueryRow(query *Where, toFill ...interface{}) (found bool)
- func (db *DB) Rollback()
- type DuplicatedKeyError
- type Engine
- type Entity
- type EntityLog
- type Enum
- type Event
- type EventBroker
- type EventConsumerHandler
- type EventFlusher
- type EventsConsumer
- type ExecResult
- type Flusher
- type ForeignKeyError
- type LazyFlushQueryErrorResolver
- type LocalCache
- func (c *LocalCache) Clear()
- func (c *LocalCache) Get(key string) (value interface{}, ok bool)
- func (c *LocalCache) GetObjectsCount() int
- func (c *LocalCache) GetPoolConfig() LocalCachePoolConfig
- func (c *LocalCache) GetSet(key string, ttl time.Duration, provider func() interface{}) interface{}
- func (c *LocalCache) MGet(keys ...string) []interface{}
- func (c *LocalCache) MSet(pairs ...interface{})
- func (c *LocalCache) Remove(keys ...string)
- func (c *LocalCache) Set(key string, value interface{})
- type LocalCachePoolConfig
- type Lock
- type Locker
- type LogHandler
- type LogQueueValue
- type MySQLPoolConfig
- type ORM
- func (orm *ORM) Clone() Entity
- func (orm *ORM) GetDirtyBind() (bind Bind, has bool)
- func (orm *ORM) GetID() uint64
- func (orm *ORM) IsDirty() bool
- func (orm *ORM) IsLoaded() bool
- func (orm *ORM) IsToDelete() bool
- func (orm *ORM) SetEntityLogMeta(key string, value interface{})
- func (orm *ORM) SetField(field string, value interface{}) error
- func (orm *ORM) SetMemoryOnly(memory bool)
- func (orm *ORM) SetOnDuplicateKeyUpdate(bind Bind)
- type Pager
- type PipeLineBool
- type PipeLineGet
- type PipeLineInt
- type PipeLineString
- type QueryLoggerSource
- type RedisCache
- func (r *RedisCache) Del(keys ...string)
- func (r *RedisCache) Eval(script string, keys []string, args ...interface{}) interface{}
- func (r *RedisCache) EvalSha(sha1 string, keys []string, args ...interface{}) (res interface{}, exists bool)
- func (r *RedisCache) Exists(keys ...string) int64
- func (r *RedisCache) Expire(key string, expiration time.Duration) bool
- func (r *RedisCache) FlushAll()
- func (r *RedisCache) FlushDB()
- func (r *RedisCache) Get(key string) (value string, has bool)
- func (r *RedisCache) GetLocker() *Locker
- func (r *RedisCache) GetPoolConfig() RedisPoolConfig
- func (r *RedisCache) GetSet(key string, ttlSeconds int, provider func() interface{}) interface{}
- func (r *RedisCache) HDel(key string, fields ...string)
- func (r *RedisCache) HGet(key, field string) (value string, has bool)
- func (r *RedisCache) HGetAll(key string) map[string]string
- func (r *RedisCache) HIncrBy(key, field string, incr int64) int64
- func (r *RedisCache) HLen(key string) int64
- func (r *RedisCache) HMGet(key string, fields ...string) map[string]interface{}
- func (r *RedisCache) HSet(key string, values ...interface{})
- func (r *RedisCache) HSetNx(key, field string, value interface{}) bool
- func (r *RedisCache) Incr(key string) int64
- func (r *RedisCache) IncrBy(key string, incr int64) int64
- func (r *RedisCache) IncrWithExpire(key string, expire time.Duration) int64
- func (r *RedisCache) Info(section ...string) string
- func (r *RedisCache) LLen(key string) int64
- func (r *RedisCache) LPush(key string, values ...interface{}) int64
- func (r *RedisCache) LRange(key string, start, stop int64) []string
- func (r *RedisCache) LRem(key string, count int64, value interface{})
- func (r *RedisCache) LSet(key string, index int64, value interface{})
- func (r *RedisCache) Ltrim(key string, start, stop int64)
- func (r *RedisCache) MGet(keys ...string) []interface{}
- func (r *RedisCache) MSet(pairs ...interface{})
- func (r *RedisCache) PipeLine() *RedisPipeLine
- func (r *RedisCache) RPop(key string) (value string, found bool)
- func (r *RedisCache) RPush(key string, values ...interface{}) int64
- func (r *RedisCache) SAdd(key string, members ...interface{}) int64
- func (r *RedisCache) SCard(key string) int64
- func (r *RedisCache) SPop(key string) (string, bool)
- func (r *RedisCache) SPopN(key string, max int64) []string
- func (r *RedisCache) ScriptExists(sha1 string) bool
- func (r *RedisCache) ScriptLoad(script string) string
- func (r *RedisCache) Set(key string, value interface{}, ttlSeconds int)
- func (r *RedisCache) SetNX(key string, value interface{}, ttlSeconds int) bool
- func (r *RedisCache) Type(key string) string
- func (r *RedisCache) XAck(stream, group string, ids ...string) int64
- func (r *RedisCache) XClaim(a *redis.XClaimArgs) []redis.XMessage
- func (r *RedisCache) XClaimJustID(a *redis.XClaimArgs) []string
- func (r *RedisCache) XDel(stream string, ids ...string) int64
- func (r *RedisCache) XGroupCreate(stream, group, start string) (key string, exists bool)
- func (r *RedisCache) XGroupCreateMkStream(stream, group, start string) (key string, exists bool)
- func (r *RedisCache) XGroupDelConsumer(stream, group, consumer string) int64
- func (r *RedisCache) XGroupDestroy(stream, group string) int64
- func (r *RedisCache) XInfoGroups(stream string) []redis.XInfoGroup
- func (r *RedisCache) XInfoStream(stream string) *redis.XInfoStream
- func (r *RedisCache) XLen(stream string) int64
- func (r *RedisCache) XPending(stream, group string) *redis.XPending
- func (r *RedisCache) XPendingExt(a *redis.XPendingExtArgs) []redis.XPendingExt
- func (r *RedisCache) XRange(stream, start, stop string, count int64) []redis.XMessage
- func (r *RedisCache) XRead(a *redis.XReadArgs) []redis.XStream
- func (r *RedisCache) XReadGroup(ctx context.Context, a *redis.XReadGroupArgs) (streams []redis.XStream)
- func (r *RedisCache) XRevRange(stream, start, stop string, count int64) []redis.XMessage
- func (r *RedisCache) XTrim(stream string, maxLen int64) (deleted int64)
- func (r *RedisCache) ZAdd(key string, members ...redis.Z) int64
- func (r *RedisCache) ZCard(key string) int64
- func (r *RedisCache) ZCount(key string, min, max string) int64
- func (r *RedisCache) ZRangeWithScores(key string, start, stop int64) []redis.Z
- func (r *RedisCache) ZRemRangeByRank(key string, start, stop int64) int64
- func (r *RedisCache) ZRevRange(key string, start, stop int64) []string
- func (r *RedisCache) ZRevRangeWithScores(key string, start, stop int64) []redis.Z
- func (r *RedisCache) ZScore(key, member string) float64
- type RedisPipeLine
- func (rp *RedisPipeLine) Del(key ...string)
- func (rp *RedisPipeLine) Exec()
- func (rp *RedisPipeLine) Expire(key string, expiration time.Duration) *PipeLineBool
- func (rp *RedisPipeLine) Get(key string) *PipeLineGet
- func (rp *RedisPipeLine) HDel(key string, values ...string)
- func (rp *RedisPipeLine) HIncrBy(key, field string, incr int64) *PipeLineInt
- func (rp *RedisPipeLine) HSet(key string, values ...interface{})
- func (rp *RedisPipeLine) Set(key string, value interface{}, expiration time.Duration)
- func (rp *RedisPipeLine) XAdd(stream string, values []string) *PipeLineString
- type RedisPoolConfig
- type RedisStreamConsumerStatistics
- type RedisStreamGroupStatistics
- type RedisStreamStatistics
- type Registry
- func (r *Registry) InitByYaml(yaml map[string]interface{})
- func (r *Registry) RegisterEntity(entity ...Entity)
- func (r *Registry) RegisterEnum(code string, values []string, defaultValue ...string)
- func (r *Registry) RegisterEnumStruct(code string, val interface{}, defaultValue ...string)
- func (r *Registry) RegisterLocalCache(size int, code ...string)
- func (r *Registry) RegisterMySQLPool(dataSourceName string, code ...string)
- func (r *Registry) RegisterRedis(address, namespace string, db int, code ...string)
- func (r *Registry) RegisterRedisSentinel(masterName, namespace string, db int, sentinels []string, code ...string)
- func (r *Registry) RegisterRedisSentinelWithCredentials(masterName, namespace, user, password string, db int, sentinels []string, ...)
- func (r *Registry) RegisterRedisSentinelWithOptions(namespace string, opts redis.FailoverOptions, db int, sentinels []string, ...)
- func (r *Registry) RegisterRedisStream(name string, redisPool string, groups []string)
- func (r *Registry) RegisterRedisWithCredentials(address, namespace, user, password string, db int, code ...string)
- func (r *Registry) SetDefaultCollate(collate string)
- func (r *Registry) SetDefaultEncoding(encoding string)
- func (r *Registry) Validate() (validated ValidatedRegistry, err error)
- type Rows
- type SQLRow
- type SQLRows
- type TableSchema
- type ValidatedRegistry
- type Where
- func (where *Where) Append(query string, parameters ...interface{})
- func (where *Where) GetParameters() []interface{}
- func (where *Where) SetParameter(index int, param interface{}) *Where
- func (where *Where) SetParameters(params ...interface{}) *Where
- func (where *Where) ShowFakeDeleted() *Where
- func (where *Where) String() string
Constants ¶
View Source
const BackgroundConsumerGroupName = "orm-async-consumer"
View Source
const LazyChannelName = "orm-lazy-channel"
View Source
const LogChannelName = "orm-log-channel"
View Source
const RedisStreamGarbageCollectorChannelName = "orm-stream-garbage-collector"
Variables ¶
This section is empty.
Functions ¶
func DisableCacheHashCheck ¶ added in v1.1.4
func DisableCacheHashCheck()
func SetUUIDServerID ¶ added in v1.11.0
func SetUUIDServerID(id uint16)
Types ¶
type BackgroundConsumer ¶
type BackgroundConsumer struct {
// contains filtered or unexported fields
}
func NewBackgroundConsumer ¶
func NewBackgroundConsumer(engine Engine) *BackgroundConsumer
func (*BackgroundConsumer) DisableBlockMode ¶ added in v1.14.0
func (b *BackgroundConsumer) DisableBlockMode()
func (*BackgroundConsumer) GetLazyFlushEventsSample ¶ added in v1.4.2
func (r *BackgroundConsumer) GetLazyFlushEventsSample(count int64) []string
func (*BackgroundConsumer) RegisterLazyFlushQueryErrorResolver ¶ added in v1.14.0
func (r *BackgroundConsumer) RegisterLazyFlushQueryErrorResolver(resolver LazyFlushQueryErrorResolver)
func (*BackgroundConsumer) SetBlockTime ¶ added in v1.15.10
func (r *BackgroundConsumer) SetBlockTime(ttl time.Duration)
type CachedQuery ¶
type CachedQuery struct{}
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Exec ¶
func (db *DB) Exec(query string, args ...interface{}) ExecResult
func (*DB) GetPoolConfig ¶
func (db *DB) GetPoolConfig() MySQLPoolConfig
func (*DB) IsInTransaction ¶
type DuplicatedKeyError ¶
func (*DuplicatedKeyError) Error ¶
func (err *DuplicatedKeyError) Error() string
type Engine ¶
type Engine interface { Clone() Engine EnableRequestCache() SetQueryTimeLimit(seconds int) GetMysql(code ...string) *DB GetLocalCache(code ...string) *LocalCache GetRedis(code ...string) *RedisCache SetLogMetaData(key string, value interface{}) NewFlusher() Flusher Flush(entity ...Entity) FlushLazy(entity ...Entity) FlushWithCheck(entity ...Entity) error FlushWithFullCheck(entity ...Entity) error Delete(entity ...Entity) DeleteLazy(entity ...Entity) ForceDelete(entity ...Entity) GetRegistry() ValidatedRegistry SearchWithCount(where *Where, pager *Pager, entities interface{}, references ...string) (totalRows int) Search(where *Where, pager *Pager, entities interface{}, references ...string) SearchIDsWithCount(where *Where, pager *Pager, entity Entity) (results []uint64, totalRows int) SearchIDs(where *Where, pager *Pager, entity Entity) []uint64 SearchOne(where *Where, entity Entity, references ...string) (found bool) CachedSearchOne(entity Entity, indexName string, arguments ...interface{}) (found bool) CachedSearchOneWithReferences(entity Entity, indexName string, arguments []interface{}, references []string) (found bool) CachedSearch(entities interface{}, indexName string, pager *Pager, arguments ...interface{}) (totalRows int) CachedSearchIDs(entity Entity, indexName string, pager *Pager, arguments ...interface{}) (totalRows int, ids []uint64) CachedSearchCount(entity Entity, indexName string, arguments ...interface{}) int CachedSearchWithReferences(entities interface{}, indexName string, pager *Pager, arguments []interface{}, references []string) (totalRows int) ClearCacheByIDs(entity Entity, ids ...uint64) LoadByID(id uint64, entity Entity, references ...string) (found bool) Load(entity Entity, references ...string) (found bool) LoadByIDs(ids []uint64, entities interface{}, references ...string) (found bool) GetAlters() (alters []Alter) GetEventBroker() EventBroker RegisterQueryLogger(handler LogHandler, mysql, redis, local bool) EnableQueryDebug() EnableQueryDebugCustom(mysql, redis, local bool) }
type Entity ¶
type Entity interface { GetID() uint64 IsLoaded() bool IsDirty() bool IsToDelete() bool GetDirtyBind() (bind Bind, has bool) SetOnDuplicateKeyUpdate(bind Bind) SetEntityLogMeta(key string, value interface{}) SetField(field string, value interface{}) error Clone() Entity SetMemoryOnly(memory bool) // contains filtered or unexported methods }
type EventBroker ¶
type EventBroker interface { Publish(stream string, body interface{}, meta ...string) (id string) Consumer(group string) EventsConsumer NewFlusher() EventFlusher GetStreamsStatistics(stream ...string) []*RedisStreamStatistics GetStreamStatistics(stream string) *RedisStreamStatistics GetStreamGroupStatistics(stream, group string) *RedisStreamGroupStatistics }
type EventConsumerHandler ¶
type EventConsumerHandler func([]Event)
type EventFlusher ¶
type EventsConsumer ¶
type ExecResult ¶
type ForeignKeyError ¶
func (*ForeignKeyError) Error ¶
func (err *ForeignKeyError) Error() string
type LazyFlushQueryErrorResolver ¶ added in v1.14.0
type LocalCache ¶
type LocalCache struct {
// contains filtered or unexported fields
}
func (*LocalCache) Clear ¶
func (c *LocalCache) Clear()
func (*LocalCache) Get ¶
func (c *LocalCache) Get(key string) (value interface{}, ok bool)
func (*LocalCache) GetObjectsCount ¶ added in v1.0.32
func (c *LocalCache) GetObjectsCount() int
func (*LocalCache) GetPoolConfig ¶
func (c *LocalCache) GetPoolConfig() LocalCachePoolConfig
func (*LocalCache) GetSet ¶
func (c *LocalCache) GetSet(key string, ttl time.Duration, provider func() interface{}) interface{}
func (*LocalCache) MGet ¶
func (c *LocalCache) MGet(keys ...string) []interface{}
func (*LocalCache) MSet ¶
func (c *LocalCache) MSet(pairs ...interface{})
func (*LocalCache) Remove ¶
func (c *LocalCache) Remove(keys ...string)
func (*LocalCache) Set ¶
func (c *LocalCache) Set(key string, value interface{})
type LocalCachePoolConfig ¶
type LogHandler ¶
type LogHandler interface {
Handle(log map[string]interface{})
}
type LogQueueValue ¶
type MySQLPoolConfig ¶
type ORM ¶
type ORM struct {
// contains filtered or unexported fields
}
func (*ORM) GetDirtyBind ¶
func (*ORM) IsToDelete ¶ added in v1.15.3
func (*ORM) SetEntityLogMeta ¶
func (*ORM) SetMemoryOnly ¶ added in v1.20.1
func (*ORM) SetOnDuplicateKeyUpdate ¶
type Pager ¶
type Pager struct { // CurrentPage is the current page number. CurrentPage int // PageSize is the number of items per page. PageSize int }
Pager represents a paginated list of results.
func (*Pager) GetCurrentPage ¶
GetCurrentPage returns the current page number of the Pager.
func (*Pager) GetPageSize ¶
GetPageSize returns the page size of the Pager.
func (*Pager) IncrementPage ¶
func (pager *Pager) IncrementPage()
IncrementPage increments the current page number of the Pager.
type PipeLineBool ¶
type PipeLineBool struct {
// contains filtered or unexported fields
}
func (*PipeLineBool) Result ¶
func (c *PipeLineBool) Result() bool
type PipeLineGet ¶
type PipeLineGet struct {
// contains filtered or unexported fields
}
func (*PipeLineGet) Result ¶
func (c *PipeLineGet) Result() (value string, has bool)
type PipeLineInt ¶
type PipeLineInt struct {
// contains filtered or unexported fields
}
func (*PipeLineInt) Result ¶
func (c *PipeLineInt) Result() int64
type PipeLineString ¶
type PipeLineString struct {
// contains filtered or unexported fields
}
func (*PipeLineString) Result ¶
func (c *PipeLineString) Result() string
type QueryLoggerSource ¶
type QueryLoggerSource int
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func (*RedisCache) Del ¶
func (r *RedisCache) Del(keys ...string)
func (*RedisCache) Eval ¶
func (r *RedisCache) Eval(script string, keys []string, args ...interface{}) interface{}
func (*RedisCache) EvalSha ¶
func (r *RedisCache) EvalSha(sha1 string, keys []string, args ...interface{}) (res interface{}, exists bool)
func (*RedisCache) Exists ¶
func (r *RedisCache) Exists(keys ...string) int64
func (*RedisCache) FlushAll ¶
func (r *RedisCache) FlushAll()
func (*RedisCache) FlushDB ¶
func (r *RedisCache) FlushDB()
func (*RedisCache) GetLocker ¶
func (r *RedisCache) GetLocker() *Locker
func (*RedisCache) GetPoolConfig ¶
func (r *RedisCache) GetPoolConfig() RedisPoolConfig
func (*RedisCache) GetSet ¶
func (r *RedisCache) GetSet(key string, ttlSeconds int, provider func() interface{}) interface{}
func (*RedisCache) HDel ¶
func (r *RedisCache) HDel(key string, fields ...string)
func (*RedisCache) HLen ¶
func (r *RedisCache) HLen(key string) int64
func (*RedisCache) HMGet ¶
func (r *RedisCache) HMGet(key string, fields ...string) map[string]interface{}
func (*RedisCache) HSet ¶
func (r *RedisCache) HSet(key string, values ...interface{})
func (*RedisCache) HSetNx ¶ added in v1.0.18
func (r *RedisCache) HSetNx(key, field string, value interface{}) bool
func (*RedisCache) Incr ¶
func (r *RedisCache) Incr(key string) int64
func (*RedisCache) IncrWithExpire ¶ added in v1.0.29
func (r *RedisCache) IncrWithExpire(key string, expire time.Duration) int64
func (*RedisCache) Info ¶
func (r *RedisCache) Info(section ...string) string
func (*RedisCache) LLen ¶
func (r *RedisCache) LLen(key string) int64
func (*RedisCache) LPush ¶
func (r *RedisCache) LPush(key string, values ...interface{}) int64
func (*RedisCache) LRem ¶
func (r *RedisCache) LRem(key string, count int64, value interface{})
func (*RedisCache) LSet ¶
func (r *RedisCache) LSet(key string, index int64, value interface{})
func (*RedisCache) Ltrim ¶
func (r *RedisCache) Ltrim(key string, start, stop int64)
func (*RedisCache) MGet ¶
func (r *RedisCache) MGet(keys ...string) []interface{}
func (*RedisCache) MSet ¶
func (r *RedisCache) MSet(pairs ...interface{})
func (*RedisCache) PipeLine ¶
func (r *RedisCache) PipeLine() *RedisPipeLine
func (*RedisCache) RPush ¶
func (r *RedisCache) RPush(key string, values ...interface{}) int64
func (*RedisCache) SAdd ¶
func (r *RedisCache) SAdd(key string, members ...interface{}) int64
func (*RedisCache) SCard ¶
func (r *RedisCache) SCard(key string) int64
func (*RedisCache) ScriptExists ¶ added in v1.3.13
func (r *RedisCache) ScriptExists(sha1 string) bool
func (*RedisCache) ScriptLoad ¶
func (r *RedisCache) ScriptLoad(script string) string
func (*RedisCache) Set ¶
func (r *RedisCache) Set(key string, value interface{}, ttlSeconds int)
func (*RedisCache) SetNX ¶
func (r *RedisCache) SetNX(key string, value interface{}, ttlSeconds int) bool
func (*RedisCache) Type ¶
func (r *RedisCache) Type(key string) string
func (*RedisCache) XClaim ¶
func (r *RedisCache) XClaim(a *redis.XClaimArgs) []redis.XMessage
func (*RedisCache) XClaimJustID ¶
func (r *RedisCache) XClaimJustID(a *redis.XClaimArgs) []string
func (*RedisCache) XGroupCreate ¶
func (r *RedisCache) XGroupCreate(stream, group, start string) (key string, exists bool)
func (*RedisCache) XGroupCreateMkStream ¶
func (r *RedisCache) XGroupCreateMkStream(stream, group, start string) (key string, exists bool)
func (*RedisCache) XGroupDelConsumer ¶
func (r *RedisCache) XGroupDelConsumer(stream, group, consumer string) int64
func (*RedisCache) XGroupDestroy ¶
func (r *RedisCache) XGroupDestroy(stream, group string) int64
func (*RedisCache) XInfoGroups ¶
func (r *RedisCache) XInfoGroups(stream string) []redis.XInfoGroup
func (*RedisCache) XInfoStream ¶
func (r *RedisCache) XInfoStream(stream string) *redis.XInfoStream
func (*RedisCache) XLen ¶
func (r *RedisCache) XLen(stream string) int64
func (*RedisCache) XPending ¶
func (r *RedisCache) XPending(stream, group string) *redis.XPending
func (*RedisCache) XPendingExt ¶
func (r *RedisCache) XPendingExt(a *redis.XPendingExtArgs) []redis.XPendingExt
func (*RedisCache) XRange ¶
func (r *RedisCache) XRange(stream, start, stop string, count int64) []redis.XMessage
func (*RedisCache) XRead ¶
func (r *RedisCache) XRead(a *redis.XReadArgs) []redis.XStream
func (*RedisCache) XReadGroup ¶
func (r *RedisCache) XReadGroup(ctx context.Context, a *redis.XReadGroupArgs) (streams []redis.XStream)
func (*RedisCache) XRevRange ¶
func (r *RedisCache) XRevRange(stream, start, stop string, count int64) []redis.XMessage
func (*RedisCache) ZAdd ¶
func (r *RedisCache) ZAdd(key string, members ...redis.Z) int64
func (*RedisCache) ZCard ¶
func (r *RedisCache) ZCard(key string) int64
func (*RedisCache) ZRangeWithScores ¶
func (r *RedisCache) ZRangeWithScores(key string, start, stop int64) []redis.Z
func (*RedisCache) ZRemRangeByRank ¶ added in v1.5.6
func (r *RedisCache) ZRemRangeByRank(key string, start, stop int64) int64
func (*RedisCache) ZRevRange ¶
func (r *RedisCache) ZRevRange(key string, start, stop int64) []string
func (*RedisCache) ZRevRangeWithScores ¶
func (r *RedisCache) ZRevRangeWithScores(key string, start, stop int64) []redis.Z
func (*RedisCache) ZScore ¶
func (r *RedisCache) ZScore(key, member string) float64
type RedisPipeLine ¶
type RedisPipeLine struct {
// contains filtered or unexported fields
}
func (*RedisPipeLine) Del ¶
func (rp *RedisPipeLine) Del(key ...string)
func (*RedisPipeLine) Exec ¶
func (rp *RedisPipeLine) Exec()
func (*RedisPipeLine) Expire ¶
func (rp *RedisPipeLine) Expire(key string, expiration time.Duration) *PipeLineBool
func (*RedisPipeLine) Get ¶
func (rp *RedisPipeLine) Get(key string) *PipeLineGet
func (*RedisPipeLine) HDel ¶
func (rp *RedisPipeLine) HDel(key string, values ...string)
func (*RedisPipeLine) HIncrBy ¶
func (rp *RedisPipeLine) HIncrBy(key, field string, incr int64) *PipeLineInt
func (*RedisPipeLine) HSet ¶
func (rp *RedisPipeLine) HSet(key string, values ...interface{})
func (*RedisPipeLine) Set ¶
func (rp *RedisPipeLine) Set(key string, value interface{}, expiration time.Duration)
func (*RedisPipeLine) XAdd ¶
func (rp *RedisPipeLine) XAdd(stream string, values []string) *PipeLineString
type RedisPoolConfig ¶
type RedisStreamConsumerStatistics ¶ added in v1.13.0
type RedisStreamGroupStatistics ¶ added in v1.13.0
type RedisStreamStatistics ¶ added in v1.13.0
type RedisStreamStatistics struct { Stream string RedisPool string Len uint64 OldestEventSeconds int Groups []*RedisStreamGroupStatistics }
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) InitByYaml ¶
func (*Registry) RegisterEntity ¶
func (*Registry) RegisterEnum ¶
func (*Registry) RegisterEnumStruct ¶
func (*Registry) RegisterLocalCache ¶
func (*Registry) RegisterMySQLPool ¶
func (*Registry) RegisterRedis ¶
func (*Registry) RegisterRedisSentinel ¶
func (*Registry) RegisterRedisSentinelWithCredentials ¶ added in v1.3.23
func (*Registry) RegisterRedisSentinelWithOptions ¶ added in v1.9.0
func (*Registry) RegisterRedisStream ¶
func (*Registry) RegisterRedisWithCredentials ¶ added in v1.3.23
func (*Registry) SetDefaultCollate ¶ added in v1.2.2
func (*Registry) SetDefaultEncoding ¶
func (*Registry) Validate ¶
func (r *Registry) Validate() (validated ValidatedRegistry, err error)
type TableSchema ¶
type TableSchema interface { GetTableName() string GetType() reflect.Type NewEntity() Entity DropTable(engine Engine) TruncateTable(engine Engine) UpdateSchema(engine Engine) UpdateSchemaAndTruncateTable(engine Engine) GetMysql(engine Engine) *DB GetLocalCache(engine Engine) (cache *LocalCache, has bool) GetRedisCache(engine Engine) (cache *RedisCache, has bool) GetReferences() []string GetColumns() []string GetUniqueIndexes() map[string][]string GetSchemaChanges(engine Engine) (has bool, alters []Alter) GetUsage(registry ValidatedRegistry) map[reflect.Type][]string GetEntityLogs(engine Engine, entityID uint64, pager *Pager, where *Where) []EntityLog }
type ValidatedRegistry ¶
type ValidatedRegistry interface { CreateEngine() Engine GetTableSchema(entityName string) TableSchema GetTableSchemaForEntity(entity Entity) TableSchema GetTableSchemaForCachePrefix(cachePrefix string) TableSchema GetSourceRegistry() *Registry GetEnum(code string) Enum GetRedisStreams() map[string]map[string][]string GetMySQLPools() map[string]MySQLPoolConfig GetLocalCachePools() map[string]LocalCachePoolConfig GetRedisPools() map[string]RedisPoolConfig GetEntities() map[string]reflect.Type }
type Where ¶
type Where struct {
// contains filtered or unexported fields
}
func (*Where) GetParameters ¶
func (where *Where) GetParameters() []interface{}
func (*Where) SetParameter ¶
func (*Where) SetParameters ¶
func (*Where) ShowFakeDeleted ¶ added in v1.12.1
Source Files ¶
- background_consumer.go
- bind_builder.go
- cached_search.go
- clear_by_ids.go
- db.go
- engine.go
- event_broker.go
- flusher.go
- load_by_id.go
- load_by_ids.go
- local_cache.go
- locker.go
- orm.go
- pager.go
- query_logger.go
- redis_cache.go
- redis_flusher.go
- redis_pipeline.go
- redis_streams_statistics.go
- registry.go
- schema.go
- search.go
- serializer.go
- table_schema.go
- uuid.go
- validated_registry.go
- where.go
- yaml_loader.go
Click to show internal directories.
Click to hide internal directories.