Documentation ¶
Index ¶
- Constants
- Variables
- func MarshalHashObj(obj *HashObj) []byte
- func MarshalListObj(obj *ListObj) []byte
- func MarshalObj(obj IObject) []byte
- func MarshalSetObj(obj *SetObj) []byte
- func MarshalStringObj(obj *StringObj) []byte
- func MarshalZSetObj(obj *ZSetObj) []byte
- func NewGCChecker(interval, timeout, concurrency int, tdb *Tidis) *gcChecker
- func NewLeaderChecker(interval, duration int, tdb *Tidis) *leaderChecker
- func NewTTLChecker(datatype byte, max, interval int, tdb *Tidis) *ttlChecker
- func RawDBPrefix(tenantId string, dbId uint8) []byte
- func RawKeyPrefix(tenantid string, dbid uint8, key []byte) []byte
- func RawSysGCPointKey() []byte
- func RawSysLeaderKey() []byte
- func RawTenantPrefix(tenantId string) []byte
- func ZScoreDecoder(rawkeyPrefixLen int, rawkey []byte) (int64, []byte, error)
- func ZScoreOffset(score int64) uint64
- func ZScoreRestore(rscore uint64) int64
- type AsyncDelItem
- type HashObj
- type IObject
- type ListObj
- type MemberPair
- type Object
- type SetObj
- type StringObj
- type Tidis
- func (tidis *Tidis) AsyncDelAdd(keyType byte, ukey []byte) error
- func (tidis *Tidis) AsyncDelDone(keyType byte, ukey []byte) error
- func (tidis *Tidis) CheckLeader(leaderLeaseDuration int)
- func (tidis *Tidis) Close() error
- func (tidis *Tidis) Decr(dbId uint8, key []byte, step int64) (int64, error)
- func (tidis *Tidis) DecrWithTxn(dbId uint8, txn interface{}, key []byte, step int64) (int64, error)
- func (tidis *Tidis) Delete(dbId uint8, txn interface{}, keys [][]byte) (int, error)
- func (tidis *Tidis) Expire(dbId uint8, key []byte, s int64) (int, error)
- func (tidis *Tidis) ExpireAt(dbId uint8, key []byte, ts int64) (int, error)
- func (tidis *Tidis) ExpireAtWithTxn(dbId uint8, txn interface{}, key []byte, ts int64) (int, error)
- func (tidis *Tidis) ExpireWithTxn(dbId uint8, txn interface{}, key []byte, s int64) (int, error)
- func (tidis *Tidis) FlushAll() error
- func (tidis *Tidis) FlushDB(dbId uint8) error
- func (tidis *Tidis) Get(dbId uint8, txn interface{}, key []byte) ([]byte, error)
- func (tidis *Tidis) GetCurrentVersion() (uint64, error)
- func (tidis *Tidis) GetObject(dbId uint8, txn interface{}, key []byte) (byte, IObject, error)
- func (tidis *Tidis) HashMetaObj(dbId uint8, txn interface{}, key []byte) (*HashObj, error)
- func (tidis *Tidis) HashMetaObjWithExpire(dbId uint8, txn interface{}, key []byte, checkExpire bool) (*HashObj, error)
- func (tidis *Tidis) Hclear(dbId uint8, key []byte) (uint8, error)
- func (tidis *Tidis) HclearWithTxn(dbId uint8, txn1 interface{}, key []byte) (uint8, error)
- func (tidis *Tidis) Hdel(dbId uint8, key []byte, fields ...[]byte) (uint64, error)
- func (tidis *Tidis) HdelWithTxn(dbId uint8, txn interface{}, key []byte, fields ...[]byte) (uint64, error)
- func (tidis *Tidis) Hexists(dbId uint8, txn interface{}, key, field []byte) (bool, error)
- func (tidis *Tidis) Hget(dbId uint8, txn interface{}, key, field []byte) ([]byte, error)
- func (tidis *Tidis) Hgetall(dbId uint8, txn interface{}, key []byte) ([]interface{}, error)
- func (tidis *Tidis) Hkeys(dbId uint8, txn interface{}, key []byte) ([]interface{}, error)
- func (tidis *Tidis) Hlen(dbId uint8, txn interface{}, key []byte) (uint64, error)
- func (tidis *Tidis) Hmget(dbId uint8, txn interface{}, key []byte, fields ...[]byte) ([]interface{}, error)
- func (tidis *Tidis) Hmset(dbId uint8, key []byte, fieldsvalues ...[]byte) error
- func (tidis *Tidis) HmsetWithTxn(dbId uint8, txn interface{}, key []byte, fieldsvalues ...[]byte) error
- func (tidis *Tidis) Hset(dbId uint8, key, field, value []byte) (uint8, error)
- func (tidis *Tidis) HsetWithTxn(dbId uint8, txn interface{}, key, field, value []byte) (uint8, error)
- func (tidis *Tidis) Hsetnx(dbId uint8, key, field, value []byte) (uint8, error)
- func (tidis *Tidis) HsetnxWithTxn(dbId uint8, txn interface{}, key, field, value []byte) (uint8, error)
- func (tidis *Tidis) Hstrlen(dbId uint8, txn interface{}, key, field []byte) (int, error)
- func (tidis *Tidis) Hvals(dbId uint8, txn interface{}, key []byte) ([]interface{}, error)
- func (tidis *Tidis) Incr(dbId uint8, key []byte, step int64) (int64, error)
- func (tidis *Tidis) IncrWithTxn(dbId uint8, txn interface{}, key []byte, step int64) (int64, error)
- func (tidis *Tidis) IsLeader() bool
- func (tidis *Tidis) LdelWithTxn(dbId uint8, txn1 interface{}, key []byte) (int, error)
- func (tidis *Tidis) Ldelete(dbId uint8, key []byte) (int, error)
- func (tidis *Tidis) Lindex(dbId uint8, txn interface{}, key []byte, index int64) ([]byte, error)
- func (tidis *Tidis) ListMetaObj(dbId uint8, txn, ss interface{}, key []byte) (*ListObj, bool, error)
- func (tidis *Tidis) ListMetaObjWithExpire(dbId uint8, txn, ss interface{}, key []byte, checkExpire bool) (*ListObj, bool, error)
- func (tidis *Tidis) Llen(dbId uint8, txn interface{}, key []byte) (uint64, error)
- func (tidis *Tidis) Lpop(dbId uint8, txn interface{}, key []byte) ([]byte, error)
- func (tidis *Tidis) Lpush(dbId uint8, txn interface{}, key []byte, items ...[]byte) (uint64, error)
- func (tidis *Tidis) Lrange(dbId uint8, txn interface{}, key []byte, start, stop int64) ([]interface{}, error)
- func (tidis *Tidis) Lset(dbId uint8, key []byte, index int64, value []byte) error
- func (tidis *Tidis) LsetWithTxn(dbId uint8, txn interface{}, key []byte, index int64, value []byte) error
- func (tidis *Tidis) Ltrim(dbId uint8, key []byte, start, stop int64) error
- func (tidis *Tidis) LtrimWithTxn(dbId uint8, txn interface{}, key []byte, start, stop int64) error
- func (tidis *Tidis) MGet(dbId uint8, txn interface{}, keys [][]byte) ([]interface{}, error)
- func (tidis *Tidis) MSet(dbId uint8, txn interface{}, keyvals [][]byte) (int, error)
- func (tidis *Tidis) NewTxn() (interface{}, error)
- func (tidis *Tidis) PExpire(dbId uint8, key []byte, ms int64) (int, error)
- func (tidis *Tidis) PExpireAt(dbId uint8, key []byte, ts int64) (int, error)
- func (tidis *Tidis) PExpireAtWithTxn(dbId uint8, txn interface{}, key []byte, ts int64) (int, error)
- func (tidis *Tidis) PExpireWithTxn(dbId uint8, txn interface{}, key []byte, ms int64) (int, error)
- func (tidis *Tidis) PTtl(dbId uint8, txn interface{}, key []byte) (int64, error)
- func (tidis *Tidis) RawHashDataKey(dbId uint8, key, field []byte) []byte
- func (tidis *Tidis) RawKeyPrefix(dbid uint8, key []byte) []byte
- func (tidis *Tidis) RawListKey(dbId uint8, key []byte, idx uint64) []byte
- func (tidis *Tidis) RawSetDataKey(dbId uint8, key, member []byte) []byte
- func (tidis *Tidis) RawZSetDataKey(dbId uint8, key, member []byte) []byte
- func (tidis *Tidis) RawZSetScoreKey(dbId uint8, key, member []byte, score int64) []byte
- func (tidis *Tidis) Rpop(dbId uint8, txn interface{}, key []byte) ([]byte, error)
- func (tidis *Tidis) Rpush(dbId uint8, txn interface{}, key []byte, items ...[]byte) (uint64, error)
- func (tidis *Tidis) RunAsync(ctx context.Context)
- func (tidis *Tidis) RunGC(safePoint uint64, concurrency int) error
- func (tidis *Tidis) Sadd(dbId uint8, key []byte, members ...[]byte) (uint64, error)
- func (tidis *Tidis) SaddWithTxn(dbId uint8, txn interface{}, key []byte, members ...[]byte) (uint64, error)
- func (tidis *Tidis) Scard(dbId uint8, txn interface{}, key []byte) (uint64, error)
- func (tidis *Tidis) Sclear(dbId uint8, keys ...[]byte) (uint64, error)
- func (tidis *Tidis) SclearKeyWithTxn(dbId uint8, txn1 interface{}, key []byte) (int, error)
- func (tidis *Tidis) SclearWithTxn(dbId uint8, txn interface{}, keys ...[]byte) (uint64, error)
- func (tidis *Tidis) Sdiff(dbId uint8, txn interface{}, keys ...[]byte) ([]interface{}, error)
- func (tidis *Tidis) Sdiffstore(dbId uint8, dest []byte, keys ...[]byte) (uint64, error)
- func (tidis *Tidis) SdiffstoreWithTxn(dbId uint8, txn interface{}, dest []byte, keys ...[]byte) (uint64, error)
- func (tidis *Tidis) Set(dbId uint8, txn interface{}, key, value []byte) error
- func (tidis *Tidis) SetMetaObj(dbId uint8, txn, ss interface{}, key []byte) (*SetObj, bool, error)
- func (tidis *Tidis) SetMetaObjWithExpire(dbId uint8, txn, ss interface{}, key []byte, checkExpire bool) (*SetObj, bool, error)
- func (tidis *Tidis) SetWithParam(dbId uint8, txn interface{}, key, value []byte, msTtl uint64, nxFlag bool, ...) (bool, error)
- func (tidis *Tidis) Setex(dbId uint8, key []byte, sec int64, value []byte) error
- func (tidis *Tidis) SetexWithTxn(dbId uint8, txn interface{}, key []byte, sec int64, value []byte) error
- func (tidis *Tidis) Sinter(dbId uint8, txn interface{}, keys ...[]byte) ([]interface{}, error)
- func (tidis *Tidis) Sinterstore(dbId uint8, dest []byte, keys ...[]byte) (uint64, error)
- func (tidis *Tidis) SinterstoreWithTxn(dbId uint8, txn interface{}, dest []byte, keys ...[]byte) (uint64, error)
- func (tidis *Tidis) Sismember(dbId uint8, txn interface{}, key, member []byte) (uint8, error)
- func (tidis *Tidis) Smembers(dbId uint8, txn interface{}, key []byte) ([]interface{}, error)
- func (tidis *Tidis) Sops(dbId uint8, txn interface{}, opType int, keys ...[]byte) ([]interface{}, error)
- func (tidis *Tidis) SopsStore(dbId uint8, opType int, dest []byte, keys ...[]byte) (uint64, error)
- func (tidis *Tidis) SopsStoreWithTxn(dbId uint8, txn interface{}, opType int, dest []byte, keys ...[]byte) (uint64, error)
- func (tidis *Tidis) Srem(dbId uint8, key []byte, members ...[]byte) (uint64, error)
- func (tidis *Tidis) SremWithTxn(dbId uint8, txn interface{}, key []byte, members ...[]byte) (uint64, error)
- func (tidis *Tidis) Sunion(dbId uint8, txn interface{}, keys ...[]byte) ([]interface{}, error)
- func (tidis *Tidis) Sunionstore(dbId uint8, dest []byte, keys ...[]byte) (uint64, error)
- func (tidis *Tidis) SunionstoreWithTxn(dbId uint8, txn interface{}, dest []byte, keys ...[]byte) (uint64, error)
- func (tidis *Tidis) TenantId() string
- func (tidis *Tidis) Ttl(dbId uint8, txn interface{}, key []byte) (int64, error)
- func (tidis *Tidis) Type(dbId uint8, txn interface{}, key []byte) (string, error)
- func (tidis *Tidis) ZSetMetaObj(dbId uint8, txn, ss interface{}, key []byte) (*ZSetObj, bool, error)
- func (tidis *Tidis) ZSetMetaObjWithExpire(dbId uint8, txn, ss interface{}, key []byte, checkExpire bool) (*ZSetObj, bool, error)
- func (tidis *Tidis) Zadd(dbId uint8, key []byte, mps ...*MemberPair) (int, error)
- func (tidis *Tidis) ZaddWithTxn(dbId uint8, txn interface{}, key []byte, mps ...*MemberPair) (int, error)
- func (tidis *Tidis) Zcard(dbId uint8, txn interface{}, key []byte) (uint64, error)
- func (tidis *Tidis) Zcount(dbId uint8, txn interface{}, key []byte, min, max int64) (uint64, error)
- func (tidis *Tidis) Zincrby(dbId uint8, key []byte, delta int64, member []byte) (int64, error)
- func (tidis *Tidis) ZincrbyWithTxn(dbId uint8, txn interface{}, key []byte, delta int64, member []byte) (int64, error)
- func (tidis *Tidis) Zlexcount(dbId uint8, txn interface{}, key, start, stop []byte) (uint64, error)
- func (tidis *Tidis) Zrange(dbId uint8, txn interface{}, key []byte, start, stop int64, withscores bool, ...) ([]interface{}, error)
- func (tidis *Tidis) Zrangebylex(dbId uint8, txn interface{}, key []byte, start, stop []byte, offset, count int, ...) ([]interface{}, error)
- func (tidis *Tidis) Zrangebyscore(dbId uint8, txn interface{}, key []byte, min, max int64, withscores bool, ...) ([]interface{}, error)
- func (tidis *Tidis) Zrank(dbId uint8, txn interface{}, key, member []byte, score int64) (int64, bool, error)
- func (tidis *Tidis) Zrem(dbId uint8, key []byte, members ...[]byte) (uint64, error)
- func (tidis *Tidis) ZremWithTxn(dbId uint8, txn interface{}, key []byte, members ...[]byte) (uint64, error)
- func (tidis *Tidis) Zremrangebylex(dbId uint8, key, start, stop []byte) (uint64, error)
- func (tidis *Tidis) ZremrangebylexWithTxn(dbId uint8, txn interface{}, key, start, stop []byte) (uint64, error)
- func (tidis *Tidis) Zremrangebyscore(dbId uint8, key []byte, min, max int64) (uint64, error)
- func (tidis *Tidis) ZremrangebyscoreWithTxn(dbId uint8, txn1 interface{}, key []byte, min, max int64) (uint64, error)
- func (tidis *Tidis) Zscore(dbId uint8, txn interface{}, key, member []byte) (int64, bool, error)
- type ZSetObj
Constants ¶
View Source
const ( // tenant length should be less than 250, 251-255 can be used by system LeaderKey = 251 GCPointKey = 252 )
View Source
const ( LHeadDirection uint8 = 0 LTailDirection uint8 = 1 LItemMinIndex uint64 = 1024 LItemMaxIndex uint64 = 1<<64 - 1024 LItemInitIndex uint64 = 1<<32 - 512 )
View Source
const ( TSTRING byte = iota TLISTMETA TLISTDATA THASHMETA THASHDATA TSETMETA TSETDATA TZSETMETA TZSETSCORE TZSETDATA TTTLMETA TTTLDATA )
View Source
const ( FNORMAL byte = iota FDELETED )
View Source
const ( ObjectData byte = iota ObjectTTL )
View Source
const ( MetaTypeKey byte = iota DataTypeKey ScoreTypeKey )
Variables ¶
View Source
var (
EmptyListOrSet []interface{} = make([]interface{}, 0)
)
Functions ¶
func MarshalHashObj ¶ added in v1.0.0
func MarshalListObj ¶ added in v1.0.0
func MarshalObj ¶ added in v1.0.0
func MarshalSetObj ¶ added in v1.0.0
func MarshalStringObj ¶ added in v1.0.0
func MarshalZSetObj ¶ added in v1.0.0
func NewGCChecker ¶ added in v1.1.0
func NewLeaderChecker ¶ added in v1.1.0
func NewTTLChecker ¶
func RawDBPrefix ¶ added in v1.0.0
func RawKeyPrefix ¶ added in v1.0.0
tenantlen(2)|tenant|dbid(1)|typedata(1)|userkeylen(4)|userkey
func RawSysGCPointKey ¶ added in v1.1.0
func RawSysGCPointKey() []byte
func RawSysLeaderKey ¶ added in v1.1.0
func RawSysLeaderKey() []byte
func RawTenantPrefix ¶ added in v1.0.0
func ZScoreOffset ¶
func ZScoreRestore ¶
Types ¶
type AsyncDelItem ¶
type AsyncDelItem struct {
// contains filtered or unexported fields
}
type HashObj ¶ added in v1.0.0
func UnmarshalHashObj ¶ added in v1.0.0
type ListObj ¶ added in v1.0.0
func UnmarshalListObj ¶ added in v1.0.0
type MemberPair ¶
type Object ¶ added in v1.0.0
func (*Object) IsExpireSet ¶ added in v1.0.0
func (*Object) ObjectExpired ¶ added in v1.0.0
func (*Object) SetExpireAt ¶ added in v1.0.0
type SetObj ¶ added in v1.0.0
func UnmarshalSetObj ¶ added in v1.0.0
type StringObj ¶ added in v1.0.0
func UnmarshalStringObj ¶ added in v1.0.0
type Tidis ¶
func (*Tidis) CheckLeader ¶ added in v1.1.0
func (*Tidis) DecrWithTxn ¶
func (*Tidis) ExpireAtWithTxn ¶
func (*Tidis) ExpireWithTxn ¶
func (*Tidis) GetCurrentVersion ¶ added in v1.1.0
func (*Tidis) HashMetaObj ¶ added in v1.0.0
func (*Tidis) HashMetaObjWithExpire ¶ added in v1.0.0
func (*Tidis) HclearWithTxn ¶
func (*Tidis) HdelWithTxn ¶
func (*Tidis) HmsetWithTxn ¶
func (tidis *Tidis) HmsetWithTxn(dbId uint8, txn interface{}, key []byte, fieldsvalues ...[]byte) error
Deprecated
func (*Tidis) HsetWithTxn ¶
func (*Tidis) HsetnxWithTxn ¶
func (*Tidis) IncrWithTxn ¶
func (*Tidis) LdelWithTxn ¶
func (*Tidis) ListMetaObj ¶ added in v1.0.0
func (*Tidis) ListMetaObjWithExpire ¶ added in v1.0.0
func (*Tidis) Lrange ¶
func (tidis *Tidis) Lrange(dbId uint8, txn interface{}, key []byte, start, stop int64) ([]interface{}, error)
return map[string][]byte key is encoded key, not user key
func (*Tidis) LsetWithTxn ¶
func (*Tidis) LtrimWithTxn ¶
func (*Tidis) PExpireAtWithTxn ¶
func (*Tidis) PExpireWithTxn ¶
func (*Tidis) RawHashDataKey ¶ added in v1.0.0
func (*Tidis) RawKeyPrefix ¶ added in v1.0.0
func (*Tidis) RawListKey ¶ added in v1.0.0
func (*Tidis) RawSetDataKey ¶ added in v1.0.0
func (*Tidis) RawZSetDataKey ¶ added in v1.0.0
func (*Tidis) RawZSetScoreKey ¶ added in v1.0.0
func (*Tidis) SaddWithTxn ¶
func (*Tidis) SclearKeyWithTxn ¶
func (*Tidis) SclearWithTxn ¶
func (*Tidis) Sdiffstore ¶
func (*Tidis) SdiffstoreWithTxn ¶
func (*Tidis) SetMetaObj ¶ added in v1.0.0
func (*Tidis) SetMetaObjWithExpire ¶ added in v1.0.0
func (*Tidis) SetWithParam ¶
func (*Tidis) SetexWithTxn ¶
func (*Tidis) Sinterstore ¶
func (*Tidis) SinterstoreWithTxn ¶
func (*Tidis) SopsStoreWithTxn ¶
func (*Tidis) SremWithTxn ¶
func (*Tidis) Sunionstore ¶
func (*Tidis) SunionstoreWithTxn ¶
func (*Tidis) ZSetMetaObj ¶ added in v1.0.0
func (*Tidis) ZSetMetaObjWithExpire ¶ added in v1.0.0
func (*Tidis) ZaddWithTxn ¶
func (*Tidis) ZincrbyWithTxn ¶
func (*Tidis) Zrangebylex ¶
func (*Tidis) Zrangebyscore ¶
func (*Tidis) ZremWithTxn ¶
func (*Tidis) Zremrangebylex ¶
func (*Tidis) ZremrangebylexWithTxn ¶
func (*Tidis) Zremrangebyscore ¶
func (*Tidis) ZremrangebyscoreWithTxn ¶
Click to show internal directories.
Click to hide internal directories.