Documentation ¶
Index ¶
- Constants
- func DisableCacheHashCheck()
- func LoadByID[E Entity, I ID](id I, engine Engine, references ...string) (entity E, found bool)
- func RunLazyFlushConsumer(engine Engine, garbage bool)
- func RunStreamGarbageCollectorConsumer(engine Engine)
- type Alter
- type Bind
- type CachedQuery
- type ColumnSchemaDefinition
- type DB
- func (db *DB) Begin()
- func (db *DB) Commit()
- func (db *DB) Exec(query string, args ...interface{}) ExecResult
- func (db *DB) GetDBClient() DBClient
- func (db *DB) GetDBClientTX() DBClientTX
- func (db *DB) GetPoolConfig() MySQLPoolConfig
- func (db *DB) IsInTransaction() bool
- func (db *DB) Prepare(query string) (stmt PreparedStmt, close func())
- 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()
- func (db *DB) SetMockClientTX(mock DBClientTX)
- func (db *DB) SetMockDBClient(mock DBClient)
- type DBClient
- type DBClientQuery
- type DBClientTX
- type DuplicatedKeyError
- type Engine
- type Entity
- type EntitySchema
- type EntitySchemaReference
- type Enum
- type Event
- type EventBroker
- type EventConsumerHandler
- type EventEntityFlushed
- type EventEntityFlushing
- type EventsConsumer
- type ExecResult
- type FlushType
- type Flusher
- type FlusherCacheSetter
- type ID
- type IndexSchemaDefinition
- type LazyFlushConsumer
- type LazyFlushQueryErrorResolver
- type LocalCache
- type LocalCachePoolConfig
- type LocalCacheSetter
- type Lock
- type Locker
- type LogHandler
- type Meta
- type MockDBClient
- func (m *MockDBClient) Begin() (*sql.Tx, error)
- func (m *MockDBClient) Commit() error
- func (m *MockDBClient) Exec(query string, args ...interface{}) (sql.Result, error)
- func (m *MockDBClient) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (m *MockDBClient) Prepare(query string) (*sql.Stmt, error)
- func (m *MockDBClient) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (m *MockDBClient) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (m *MockDBClient) QueryRow(query string, args ...interface{}) *sql.Row
- func (m *MockDBClient) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (m *MockDBClient) Rollback() error
- type MockLogHandler
- type MySQLPoolConfig
- type MySQLPoolOptions
- type ORM
- type Pager
- type PipeLineBool
- type PipeLineGet
- type PipeLineInt
- type PipeLineString
- type Plugin
- type PluginInterfaceEngineCreated
- type PluginInterfaceEntityFlushed
- type PluginInterfaceEntityFlushing
- type PluginInterfaceEntitySearch
- type PluginInterfaceInitEntitySchema
- type PluginInterfaceInitRegistry
- type PluginInterfaceTableSQLSchemaDefinition
- type PreparedStmt
- type QueryLoggerSource
- type RedisCache
- type RedisCacheSetter
- 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) MSet(pairs ...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) GetDefaultCollate() string
- func (r *Registry) HasRegisteredRedisPool(pool string) bool
- 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, poolOptions MySQLPoolOptions, code ...string)
- func (r *Registry) RegisterMySQLTable(pool string, tableName ...string)
- func (r *Registry) RegisterPlugin(plugin Plugin)
- 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)
- func (r *Registry) RegisterRedisStreamConsumerGroups(stream 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 SettableEntitySchema
- type StreamGarbageCollectorConsumer
- type TableSQLSchemaDefinition
- type ValidatedRegistry
- type Where
Constants ¶
View Source
const DateFormat = "2006-01-02"
View Source
const LazyFlushChannelName = "orm-lazy-flush-stream"
View Source
const LazyFlushGroupName = "orm-lazy-flush-consumer"
View Source
const StreamGarbageCollectorChannelName = "orm-stream-garbage-collector-stream"
View Source
const StreamGarbageCollectorGroupName = "orm-garbage-collector-consumer"
View Source
const TimeFormat = "2006-01-02 15:04:05"
Variables ¶
This section is empty.
Functions ¶
func DisableCacheHashCheck ¶
func DisableCacheHashCheck()
func RunLazyFlushConsumer ¶
func RunStreamGarbageCollectorConsumer ¶
func RunStreamGarbageCollectorConsumer(engine Engine)
Types ¶
type CachedQuery ¶
type CachedQuery struct{}
type ColumnSchemaDefinition ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Exec ¶
func (db *DB) Exec(query string, args ...interface{}) ExecResult
func (*DB) GetDBClient ¶
func (*DB) GetDBClientTX ¶
func (db *DB) GetDBClientTX() DBClientTX
func (*DB) GetPoolConfig ¶
func (db *DB) GetPoolConfig() MySQLPoolConfig
func (*DB) IsInTransaction ¶
func (*DB) Prepare ¶
func (db *DB) Prepare(query string) (stmt PreparedStmt, close func())
func (*DB) SetMockClientTX ¶
func (db *DB) SetMockClientTX(mock DBClientTX)
func (*DB) SetMockDBClient ¶
type DBClientQuery ¶
type DBClientQuery interface { Prepare(query string) (*sql.Stmt, error) Exec(query string, args ...interface{}) (sql.Result, error) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) QueryRow(query string, args ...interface{}) *sql.Row QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row Query(query string, args ...interface{}) (*sql.Rows, error) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) }
type DBClientTX ¶
type DBClientTX interface { DBClientQuery Commit() error Rollback() error }
type DuplicatedKeyError ¶
func (*DuplicatedKeyError) Error ¶
func (err *DuplicatedKeyError) Error() string
type Engine ¶
type Engine interface { Clone() Engine GetMysql(code ...string) *DB GetLocalCache(code ...string) LocalCache GetRedis(code ...string) RedisCache IsDirty(entity Entity) bool GetDirtyBind(entity Entity) (bind Bind, has bool) NewFlusher() Flusher Flush(entity ...Entity) FlushLazy(entity ...Entity) FlushWithCheck(entity ...Entity) error FlushWithFullCheck(entity ...Entity) error Delete(entity ...Entity) DeleteLazy(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) SetPluginOption(plugin, key string, value interface{}) GetPluginOption(plugin, key string) interface{} SetMetaData(key, value string) GetMetaData() Meta HasRedisLogger() (bool, []LogHandler) }
type EntitySchema ¶
type EntitySchema interface { GetTableName() string GetEntityName() string GetType() reflect.Type NewEntity() Entity DropTable(engine Engine) TruncateTable(engine Engine) UpdateSchema(engine Engine) UpdateSchemaAndTruncateTable(engine Engine) GetMysql(engine Engine) *DB GetMysqlPool() string GetLocalCache(engine Engine) (cache LocalCache, has bool) GetRedisCache(engine Engine) (cache RedisCache, has bool) GetReferences() []EntitySchemaReference GetColumns() []string GetUniqueIndexes() map[string][]string GetSchemaChanges(engine Engine) (has bool, alters []Alter) GetUsage(registry ValidatedRegistry) map[reflect.Type][]string GetTag(field, key, trueValue, defaultValue string) string GetPluginOption(plugin, key string) interface{} DisableCache(local, redis bool) }
type EntitySchemaReference ¶ added in v2.7.6
type EventBroker ¶
type EventBroker interface { Publish(stream string, body interface{}, meta Meta) (id string) Consumer(group string) EventsConsumer GetStreamsStatistics(stream ...string) []*RedisStreamStatistics GetStreamStatistics(stream string) *RedisStreamStatistics GetStreamGroupStatistics(stream, group string) *RedisStreamGroupStatistics }
type EventConsumerHandler ¶
type EventConsumerHandler func(events []Event)
type EventEntityFlushed ¶
type EventEntityFlushing ¶
type EventsConsumer ¶
type ExecResult ¶
type FlusherCacheSetter ¶
type FlusherCacheSetter interface { GetLocalCacheSetter(code ...string) LocalCacheSetter GetRedisCacheSetter(code ...string) RedisCacheSetter PublishToStream(stream string, body interface{}, meta Meta) }
type IndexSchemaDefinition ¶
type IndexSchemaDefinition struct { Name string Unique bool // contains filtered or unexported fields }
func (*IndexSchemaDefinition) GetColumns ¶
func (ti *IndexSchemaDefinition) GetColumns() []string
func (*IndexSchemaDefinition) SetColumns ¶
func (ti *IndexSchemaDefinition) SetColumns(columns []string)
type LazyFlushConsumer ¶
type LazyFlushConsumer struct {
// contains filtered or unexported fields
}
func NewLazyFlushConsumer ¶
func NewLazyFlushConsumer(engine Engine) *LazyFlushConsumer
func (*LazyFlushConsumer) RegisterLazyFlushQueryErrorResolver ¶
func (r *LazyFlushConsumer) RegisterLazyFlushQueryErrorResolver(resolver LazyFlushQueryErrorResolver)
func (*LazyFlushConsumer) SetBlockTime ¶
func (b *LazyFlushConsumer) SetBlockTime(seconds int)
type LazyFlushQueryErrorResolver ¶
type LazyFlushQueryErrorResolver func(engine Engine, event EventEntityFlushed, queryError *mysql.MySQLError) error
type LocalCache ¶
type LocalCache interface { LocalCacheSetter GetPoolConfig() LocalCachePoolConfig GetSet(key interface{}, ttl time.Duration, provider func() interface{}) interface{} Get(key interface{}) (value interface{}, ok bool) Clear() GetObjectsCount() int }
type LocalCachePoolConfig ¶
type LocalCacheSetter ¶
type LocalCacheSetter interface { Set(key interface{}, value interface{}) MSet(pairs ...interface{}) Remove(keys ...interface{}) }
type LogHandler ¶
type MockDBClient ¶
type MockDBClient struct { OriginDB DBClient TX DBClientTX PrepareMock func(query string) (*sql.Stmt, error) ExecMock func(query string, args ...interface{}) (sql.Result, error) ExecContextMock func(context context.Context, query string, args ...interface{}) (sql.Result, error) QueryRowMock func(query string, args ...interface{}) *sql.Row QueryRowContextMock func(ctx context.Context, query string, args ...interface{}) *sql.Row QueryMock func(query string, args ...interface{}) (*sql.Rows, error) QueryContextMock func(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) BeginMock func() (*sql.Tx, error) CommitMock func() error RollbackMock func() error }
func (*MockDBClient) Commit ¶
func (m *MockDBClient) Commit() error
func (*MockDBClient) Exec ¶
func (m *MockDBClient) Exec(query string, args ...interface{}) (sql.Result, error)
func (*MockDBClient) ExecContext ¶
func (*MockDBClient) Query ¶
func (m *MockDBClient) Query(query string, args ...interface{}) (*sql.Rows, error)
func (*MockDBClient) QueryContext ¶
func (*MockDBClient) QueryRow ¶
func (m *MockDBClient) QueryRow(query string, args ...interface{}) *sql.Row
func (*MockDBClient) QueryRowContext ¶
func (*MockDBClient) Rollback ¶
func (m *MockDBClient) Rollback() error
type MockLogHandler ¶
type MockLogHandler struct {
Logs []map[string]interface{}
}
func (*MockLogHandler) Clear ¶
func (h *MockLogHandler) Clear()
func (*MockLogHandler) Handle ¶
func (h *MockLogHandler) Handle(_ Engine, log map[string]interface{})
type MySQLPoolConfig ¶
type MySQLPoolOptions ¶
type ORM ¶
type ORM struct {
// contains filtered or unexported fields
}
func (*ORM) GetMetaData ¶
func (*ORM) SetMetaData ¶
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 PluginInterfaceEngineCreated ¶
type PluginInterfaceEngineCreated interface {
PluginInterfaceEngineCreated(engine Engine)
}
type PluginInterfaceEntityFlushed ¶
type PluginInterfaceEntityFlushed interface {
PluginInterfaceEntityFlushed(engine Engine, event EventEntityFlushed, cacheFlusher FlusherCacheSetter)
}
type PluginInterfaceEntityFlushing ¶
type PluginInterfaceEntityFlushing interface {
PluginInterfaceEntityFlushing(engine Engine, event EventEntityFlushing)
}
type PluginInterfaceEntitySearch ¶
type PluginInterfaceEntitySearch interface {
PluginInterfaceEntitySearch(engine Engine, schema EntitySchema, where *Where) *Where
}
type PluginInterfaceInitEntitySchema ¶
type PluginInterfaceInitEntitySchema interface {
InterfaceInitEntitySchema(schema SettableEntitySchema, registry *Registry) error
}
type PluginInterfaceInitRegistry ¶
type PluginInterfaceInitRegistry interface {
PluginInterfaceInitRegistry(registry *Registry)
}
type PluginInterfaceTableSQLSchemaDefinition ¶
type PluginInterfaceTableSQLSchemaDefinition interface {
PluginInterfaceTableSQLSchemaDefinition(engine Engine, sqlSchema *TableSQLSchemaDefinition) error
}
type PreparedStmt ¶
type QueryLoggerSource ¶
type QueryLoggerSource int
type RedisCache ¶
type RedisCache interface { RedisCacheSetter GetSet(key string, expiration time.Duration, provider func() interface{}) interface{} PipeLine() *RedisPipeLine Info(section ...string) string GetPoolConfig() RedisPoolConfig Get(key string) (value string, has bool) Eval(script string, keys []string, args ...interface{}) interface{} EvalSha(sha1 string, keys []string, args ...interface{}) (res interface{}, exists bool) SetNX(key string, value interface{}, expiration time.Duration) bool ScriptExists(sha1 string) bool ScriptLoad(script string) string LPush(key string, values ...interface{}) int64 RPush(key string, values ...interface{}) int64 LLen(key string) int64 Exists(keys ...string) int64 Type(key string) string LRange(key string, start, stop int64) []string LSet(key string, index int64, value interface{}) RPop(key string) (value string, found bool) LRem(key string, count int64, value interface{}) Ltrim(key string, start, stop int64) HSetNx(key, field string, value interface{}) bool HDel(key string, fields ...string) HMGet(key string, fields ...string) map[string]interface{} HGetAll(key string) map[string]string HGet(key, field string) (value string, has bool) HLen(key string) int64 HIncrBy(key, field string, incr int64) int64 IncrBy(key string, incr int64) int64 Incr(key string) int64 IncrWithExpire(key string, expire time.Duration) int64 Expire(key string, expiration time.Duration) bool ZAdd(key string, members ...redis.Z) int64 ZRem(key string, members ...interface{}) int64 ZRevRange(key string, start, stop int64) []string ZRevRangeWithScores(key string, start, stop int64) []redis.Z ZRangeWithScores(key string, start, stop int64) []redis.Z ZRangeArgs(args redis.ZRangeArgs) []string ZCard(key string) int64 ZCount(key string, min, max string) int64 ZScore(key, member string) float64 MGet(keys ...string) []interface{} SAdd(key string, members ...interface{}) int64 SCard(key string) int64 SPop(key string) (string, bool) SPopN(key string, max int64) []string XTrim(stream string, maxLen int64) (deleted int64) XRange(stream, start, stop string, count int64) []redis.XMessage XRevRange(stream, start, stop string, count int64) []redis.XMessage XInfoStream(stream string) *redis.XInfoStream XInfoGroups(stream string) []redis.XInfoGroup XGroupCreate(stream, group, start string) (key string, exists bool) XGroupCreateMkStream(stream, group, start string) (key string, exists bool) XGroupDestroy(stream, group string) int64 XRead(a *redis.XReadArgs) []redis.XStream XDel(stream string, ids ...string) int64 XGroupDelConsumer(stream, group, consumer string) int64 XReadGroup(ctx context.Context, a *redis.XReadGroupArgs) (streams []redis.XStream) XPending(stream, group string) *redis.XPending XPendingExt(a *redis.XPendingExtArgs) []redis.XPendingExt XLen(stream string) int64 XClaim(a *redis.XClaimArgs) []redis.XMessage XClaimJustID(a *redis.XClaimArgs) []string XAck(stream, group string, ids ...string) int64 FlushAll() FlushDB() GetLocker() *Locker Process(ctx context.Context, cmd redis.Cmder) error HasNamespace() bool GetNamespace() string GetCode() string RemoveNamespacePrefix(key string) string AddNamespacePrefix(key string) string // contains filtered or unexported methods }
type RedisCacheSetter ¶
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) MSet ¶
func (rp *RedisPipeLine) MSet(pairs ...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 RedisStreamStatistics ¶
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) GetDefaultCollate ¶
func (*Registry) HasRegisteredRedisPool ¶ added in v2.10.0
func (*Registry) InitByYaml ¶
func (*Registry) RegisterEntity ¶
func (*Registry) RegisterEnum ¶
func (*Registry) RegisterEnumStruct ¶
func (*Registry) RegisterLocalCache ¶
func (*Registry) RegisterMySQLPool ¶
func (r *Registry) RegisterMySQLPool(dataSourceName string, poolOptions MySQLPoolOptions, code ...string)
func (*Registry) RegisterMySQLTable ¶
func (*Registry) RegisterPlugin ¶
func (*Registry) RegisterRedis ¶
func (*Registry) RegisterRedisSentinel ¶
func (*Registry) RegisterRedisSentinelWithCredentials ¶
func (*Registry) RegisterRedisSentinelWithOptions ¶
func (*Registry) RegisterRedisStream ¶
func (*Registry) RegisterRedisStreamConsumerGroups ¶
func (*Registry) RegisterRedisWithCredentials ¶
func (*Registry) SetDefaultCollate ¶
func (*Registry) SetDefaultEncoding ¶
func (*Registry) Validate ¶
func (r *Registry) Validate() (validated ValidatedRegistry, err error)
type SettableEntitySchema ¶
type SettableEntitySchema interface { EntitySchema SetPluginOption(plugin, key string, value interface{}) }
type StreamGarbageCollectorConsumer ¶
type StreamGarbageCollectorConsumer struct {
// contains filtered or unexported fields
}
func NewStreamGarbageCollectorConsumer ¶
func NewStreamGarbageCollectorConsumer(engine Engine) *StreamGarbageCollectorConsumer
func (*StreamGarbageCollectorConsumer) Digest ¶
func (r *StreamGarbageCollectorConsumer) Digest(ctx context.Context) bool
func (*StreamGarbageCollectorConsumer) SetBlockTime ¶
func (b *StreamGarbageCollectorConsumer) SetBlockTime(seconds int)
type TableSQLSchemaDefinition ¶
type TableSQLSchemaDefinition struct { EntitySchema EntitySchema EntityColumns []*ColumnSchemaDefinition EntityIndexes []*IndexSchemaDefinition DBTableColumns []*ColumnSchemaDefinition DBIndexes []*IndexSchemaDefinition DBCreateSchema string DBEncoding string PreAlters []Alter PostAlters []Alter // contains filtered or unexported fields }
func (*TableSQLSchemaDefinition) CreateTableSQL ¶
func (td *TableSQLSchemaDefinition) CreateTableSQL() string
type ValidatedRegistry ¶
type ValidatedRegistry interface { CreateEngine() Engine GetEntitySchema(entityName string) EntitySchema GetEntitySchemaForEntity(entity Entity) EntitySchema GetEntitySchemaForCachePrefix(cachePrefix string) EntitySchema 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 GetPlugins() []string GetPlugin(code string) Plugin }
type Where ¶
type Where struct {
// contains filtered or unexported fields
}
func (*Where) GetParameters ¶
func (where *Where) GetParameters() []interface{}
func (*Where) SetParameter ¶
func (*Where) SetParameters ¶
Source Files ¶
- cached_search.go
- clear_by_ids.go
- db.go
- engine.go
- entity_schema.go
- entity_sql_flush.go
- event_broker.go
- flusher.go
- lazy_flush_consumer.go
- load_by_id.go
- load_by_ids.go
- local_cache.go
- locker.go
- orm.go
- pager.go
- plugin.go
- query_logger.go
- redis_cache.go
- redis_pipeline.go
- redis_streams_statistics.go
- registry.go
- schema.go
- search.go
- serializer.go
- stream_garbage_collector.go
- test.go
- validated_registry.go
- where.go
- yaml_loader.go
Click to show internal directories.
Click to hide internal directories.