Versions in this module Expand all Collapse all v1 v1.0.0 Aug 10, 2023 Changes in this version + const AggregateMax + const AggregateMin + const AggregateSum + const BitAND + const BitNot + const BitOR + const BitXOR + const DiffType + const ExpMetaType + const ExpTimeType + const HSizeType + const HashName + const HashType + const InterType + const InvalidScore + const KVName + const KVType + const LMetaType + const ListName + const ListType + const MaxDatabases + const MaxHashFieldSize + const MaxKeySize + const MaxScore + const MaxSetMemberSize + const MaxValueSize + const MaxZSetMemberSize + const MetaType + const MinScore + const NoneType + const ObsoleteExpTimeType + const SSizeType + const SetName + const SetType + const UnionType + const Version + const ZScoreType + const ZSetName + const ZSetType + const ZSizeType + var ErrLogMissed = errors.New("log is pured in server") + var ErrRplInRDWR = errors.New("replication not support in read write mode") + var ErrRplNotSupport = errors.New("replication not support") + var ErrScoreMiss = errors.New("zset score miss") + var ErrWriteInROnly = errors.New("write not support in readonly mode") + var TypeName = map[byte]string + func AsyncNotify(ch chan struct{}) + func Int64(v []byte, err error) (int64, error) + func PutInt64(v int64) []byte + func StrInt32(v []byte, err error) (int32, error) + func StrInt64(v []byte, err error) (int64, error) + func StrInt8(v []byte, err error) (int8, error) + func StrUint64(v []byte, err error) (uint64, error) + func Uint64(v []byte, err error) (uint64, error) + type DB struct + func (db *DB) Append(key []byte, value []byte) (int64, error) + func (db *DB) BLPop(keys [][]byte, timeout time.Duration) ([]interface{}, error) + func (db *DB) BRPop(keys [][]byte, timeout time.Duration) ([]interface{}, error) + func (db *DB) BitCount(key []byte, start int, end int) (int64, error) + func (db *DB) BitOP(op string, destKey []byte, srcKeys ...[]byte) (int64, error) + func (db *DB) BitPos(key []byte, on int, start int, end int) (int64, error) + func (db *DB) Decr(key []byte) (int64, error) + func (db *DB) DecrBy(key []byte, decrement int64) (int64, error) + func (db *DB) Del(keys ...[]byte) (int64, error) + func (db *DB) Dump(key []byte) ([]byte, error) + func (db *DB) Exists(key []byte) (int64, error) + func (db *DB) Expire(key []byte, duration int64) (int64, error) + func (db *DB) ExpireAt(key []byte, when int64) (int64, error) + func (db *DB) FlushAll() (drop int64, err error) + func (db *DB) Get(key []byte) ([]byte, error) + func (db *DB) GetBit(key []byte, offset int) (int64, error) + func (db *DB) GetRange(key []byte, start int, end int) ([]byte, error) + func (db *DB) GetSet(key []byte, value []byte) ([]byte, error) + func (db *DB) GetSlice(key []byte) (store.Slice, error) + func (db *DB) HClear(key []byte) (int64, error) + func (db *DB) HDel(key []byte, args ...[]byte) (int64, error) + func (db *DB) HDump(key []byte) ([]byte, error) + func (db *DB) HExpire(key []byte, duration int64) (int64, error) + func (db *DB) HExpireAt(key []byte, when int64) (int64, error) + func (db *DB) HGet(key []byte, field []byte) ([]byte, error) + func (db *DB) HGetAll(key []byte) ([]FVPair, error) + func (db *DB) HIncrBy(key []byte, field []byte, delta int64) (int64, error) + func (db *DB) HKeyExists(key []byte) (int64, error) + func (db *DB) HKeys(key []byte) ([][]byte, error) + func (db *DB) HLen(key []byte) (int64, error) + func (db *DB) HMclear(keys ...[]byte) (int64, error) + func (db *DB) HMget(key []byte, args ...[]byte) ([][]byte, error) + func (db *DB) HMset(key []byte, args ...FVPair) error + func (db *DB) HPersist(key []byte) (int64, error) + func (db *DB) HRevScan(key []byte, cursor []byte, count int, inclusive bool, match string) ([]FVPair, error) + func (db *DB) HScan(key []byte, cursor []byte, count int, inclusive bool, match string) ([]FVPair, error) + func (db *DB) HSet(key []byte, field []byte, value []byte) (int64, error) + func (db *DB) HTTL(key []byte) (int64, error) + func (db *DB) HValues(key []byte) ([][]byte, error) + func (db *DB) Incr(key []byte) (int64, error) + func (db *DB) IncrBy(key []byte, increment int64) (int64, error) + func (db *DB) Index() int + func (db *DB) LClear(key []byte) (int64, error) + func (db *DB) LDump(key []byte) ([]byte, error) + func (db *DB) LExpire(key []byte, duration int64) (int64, error) + func (db *DB) LExpireAt(key []byte, when int64) (int64, error) + func (db *DB) LIndex(key []byte, index int32) ([]byte, error) + func (db *DB) LKeyExists(key []byte) (int64, error) + func (db *DB) LLen(key []byte) (int64, error) + func (db *DB) LMclear(keys ...[]byte) (int64, error) + func (db *DB) LPersist(key []byte) (int64, error) + func (db *DB) LPop(key []byte) ([]byte, error) + func (db *DB) LPush(key []byte, args ...[]byte) (int64, error) + func (db *DB) LRange(key []byte, start int32, stop int32) ([][]byte, error) + func (db *DB) LSet(key []byte, index int32, value []byte) error + func (db *DB) LTTL(key []byte) (int64, error) + func (db *DB) LTrim(key []byte, start, stop int64) error + func (db *DB) LTrimBack(key []byte, trimSize int32) (int32, error) + func (db *DB) LTrimFront(key []byte, trimSize int32) (int32, error) + func (db *DB) MGet(keys ...[]byte) ([][]byte, error) + func (db *DB) MSet(args ...KVPair) error + func (db *DB) Persist(key []byte) (int64, error) + func (db *DB) RPop(key []byte) ([]byte, error) + func (db *DB) RPush(key []byte, args ...[]byte) (int64, error) + func (db *DB) Restore(key []byte, ttl int64, data []byte) error + func (db *DB) RevScan(dataType DataType, cursor []byte, count int, inclusive bool, match string) ([][]byte, error) + func (db *DB) SAdd(key []byte, args ...[]byte) (int64, error) + func (db *DB) SCard(key []byte) (int64, error) + func (db *DB) SClear(key []byte) (int64, error) + func (db *DB) SDiff(keys ...[]byte) ([][]byte, error) + func (db *DB) SDiffStore(dstKey []byte, keys ...[]byte) (int64, error) + func (db *DB) SDump(key []byte) ([]byte, error) + func (db *DB) SExpire(key []byte, duration int64) (int64, error) + func (db *DB) SExpireAt(key []byte, when int64) (int64, error) + func (db *DB) SInter(keys ...[]byte) ([][]byte, error) + func (db *DB) SInterStore(dstKey []byte, keys ...[]byte) (int64, error) + func (db *DB) SIsMember(key []byte, member []byte) (int64, error) + func (db *DB) SKeyExists(key []byte) (int64, error) + func (db *DB) SMclear(keys ...[]byte) (int64, error) + func (db *DB) SMembers(key []byte) ([][]byte, error) + func (db *DB) SPersist(key []byte) (int64, error) + func (db *DB) SRem(key []byte, args ...[]byte) (int64, error) + func (db *DB) SRevScan(key []byte, cursor []byte, count int, inclusive bool, match string) ([][]byte, error) + func (db *DB) SScan(key []byte, cursor []byte, count int, inclusive bool, match string) ([][]byte, error) + func (db *DB) STTL(key []byte) (int64, error) + func (db *DB) SUnion(keys ...[]byte) ([][]byte, error) + func (db *DB) SUnionStore(dstKey []byte, keys ...[]byte) (int64, error) + func (db *DB) Scan(dataType DataType, cursor []byte, count int, inclusive bool, match string) ([][]byte, error) + func (db *DB) Set(key []byte, value []byte) error + func (db *DB) SetBit(key []byte, offset int, on int) (int64, error) + func (db *DB) SetEX(key []byte, duration int64, value []byte) error + func (db *DB) SetNX(key []byte, value []byte) (int64, error) + func (db *DB) SetRange(key []byte, offset int, value []byte) (int64, error) + func (db *DB) StrLen(key []byte) (int64, error) + func (db *DB) TTL(key []byte) (int64, error) + func (db *DB) XLSort(key []byte, offset int, size int, alpha bool, desc bool, sortBy []byte, ...) ([][]byte, error) + func (db *DB) XSSort(key []byte, offset int, size int, alpha bool, desc bool, sortBy []byte, ...) ([][]byte, error) + func (db *DB) XZSort(key []byte, offset int, size int, alpha bool, desc bool, sortBy []byte, ...) ([][]byte, error) + func (db *DB) ZAdd(key []byte, args ...ScorePair) (int64, error) + func (db *DB) ZCard(key []byte) (int64, error) + func (db *DB) ZClear(key []byte) (int64, error) + func (db *DB) ZCount(key []byte, min int64, max int64) (int64, error) + func (db *DB) ZDump(key []byte) ([]byte, error) + func (db *DB) ZExpire(key []byte, duration int64) (int64, error) + func (db *DB) ZExpireAt(key []byte, when int64) (int64, error) + func (db *DB) ZIncrBy(key []byte, delta int64, member []byte) (int64, error) + func (db *DB) ZInterStore(destKey []byte, srcKeys [][]byte, weights []int64, aggregate byte) (int64, error) + func (db *DB) ZKeyExists(key []byte) (int64, error) + func (db *DB) ZLexCount(key []byte, min []byte, max []byte, rangeType uint8) (int64, error) + func (db *DB) ZMclear(keys ...[]byte) (int64, error) + func (db *DB) ZPersist(key []byte) (int64, error) + func (db *DB) ZRange(key []byte, start int, stop int) ([]ScorePair, error) + func (db *DB) ZRangeByLex(key []byte, min []byte, max []byte, rangeType uint8, offset int, count int) ([][]byte, error) + func (db *DB) ZRangeByScore(key []byte, min int64, max int64, offset int, count int) ([]ScorePair, error) + func (db *DB) ZRangeByScoreGeneric(key []byte, min int64, max int64, offset int, count int, reverse bool) ([]ScorePair, error) + func (db *DB) ZRangeGeneric(key []byte, start int, stop int, reverse bool) ([]ScorePair, error) + func (db *DB) ZRank(key []byte, member []byte) (int64, error) + func (db *DB) ZRem(key []byte, members ...[]byte) (int64, error) + func (db *DB) ZRemRangeByLex(key []byte, min []byte, max []byte, rangeType uint8) (int64, error) + func (db *DB) ZRemRangeByRank(key []byte, start int, stop int) (int64, error) + func (db *DB) ZRemRangeByScore(key []byte, min int64, max int64) (int64, error) + func (db *DB) ZRevRange(key []byte, start int, stop int) ([]ScorePair, error) + func (db *DB) ZRevRangeByScore(key []byte, min int64, max int64, offset int, count int) ([]ScorePair, error) + func (db *DB) ZRevRank(key []byte, member []byte) (int64, error) + func (db *DB) ZRevScan(key []byte, cursor []byte, count int, inclusive bool, match string) ([]ScorePair, error) + func (db *DB) ZScan(key []byte, cursor []byte, count int, inclusive bool, match string) ([]ScorePair, error) + func (db *DB) ZScore(key []byte, member []byte) (int64, error) + func (db *DB) ZTTL(key []byte) (int64, error) + func (db *DB) ZUnionStore(destKey []byte, srcKeys [][]byte, weights []int64, aggregate byte) (int64, error) + type DataType byte + const HASH + const KV + const LIST + const SET + const ZSET + func (d DataType) String() string + type DumpHead struct + CommitID uint64 + func (h *DumpHead) Read(r io.Reader) error + func (h *DumpHead) Write(w io.Writer) error + type FVPair struct + Field []byte + Value []byte + type KVPair struct + Key []byte + Value []byte + type Ledis struct + func Open(cfg *config.Config) (*Ledis, error) + func (l *Ledis) AddNewLogEventHandler(h NewLogEventHandler) error + func (l *Ledis) Close() + func (l *Ledis) CompactStore() error + func (l *Ledis) Dump(w io.Writer) error + func (l *Ledis) DumpFile(path string) error + func (l *Ledis) FlushAll() error + func (l *Ledis) IsReadOnly() bool + func (l *Ledis) LoadDump(r io.Reader) (*DumpHead, error) + func (l *Ledis) LoadDumpFile(path string) (*DumpHead, error) + func (l *Ledis) ReadLogsTo(startLogID uint64, w io.Writer) (n int, nextLogID uint64, err error) + func (l *Ledis) ReadLogsToTimeout(startLogID uint64, w io.Writer, timeout int, quitCh chan struct{}) (n int, nextLogID uint64, err error) + func (l *Ledis) ReplicationStat() (*rpl.Stat, error) + func (l *Ledis) ReplicationUsed() bool + func (l *Ledis) Select(index int) (*DB, error) + func (l *Ledis) StoreLogsFromData(data []byte) error + func (l *Ledis) StoreLogsFromReader(rb io.Reader) error + func (l *Ledis) StoreStat() *store.Stat + func (l *Ledis) WaitReplication() error + type Limit struct + Offset int + Size int + type NewLogEventHandler func(rl *rpl.Log) + type ScorePair struct + Member []byte + Score int64