Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeMetaKey(p []byte) (db uint32, key []byte, err error)
- func EncodeDataKeyPrefix(db uint32, key []byte) []byte
- func EncodeMetaKey(db uint32, key []byte) []byte
- func EncodeMetaKeyPrefixSlot(db uint32, slot uint32) []byte
- func EncodeMetaKeyPrefixTag(db uint32, tag []byte) []byte
- func ExpireAtToTTLms(expireat uint64) (int64, bool)
- func FormatFloat(v float64) []byte
- func FormatFloatString(v float64) string
- func FormatInt(v int64) []byte
- func FormatUint(u uint64) []byte
- func HashKeyToSlot(key []byte) ([]byte, uint32)
- func HashTag(key []byte) []byte
- func HashTagToSlot(tag []byte) uint32
- func IsExpired(expireat uint64) bool
- func Num64(i interface{}) interface{}
- func ParseFloat(i interface{}) (float64, error)
- func ParseInt(i interface{}) (int64, error)
- func ParseUint(i interface{}) (uint64, error)
- func TTLmsToExpireAt(ttlms int64) (uint64, bool)
- func TTLsToExpireAt(ttls int64) (uint64, bool)
- type Binlog
- func (b *Binlog) Append(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) Close()
- func (b *Binlog) CompactAll() error
- func (b *Binlog) Decr(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) DecrBy(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) Del(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) Dump(db uint32, args ...interface{}) (interface{}, error)
- func (b *Binlog) Exists(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) Expire(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) ExpireAt(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) Get(db uint32, args ...interface{}) ([]byte, error)
- func (b *Binlog) GetBit(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) GetRange(db uint32, args ...interface{}) ([]byte, error)
- func (b *Binlog) GetSet(db uint32, args ...interface{}) ([]byte, error)
- func (b *Binlog) HDel(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) HExists(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) HGet(db uint32, args ...interface{}) ([]byte, error)
- func (b *Binlog) HGetAll(db uint32, args ...interface{}) ([][]byte, error)
- func (b *Binlog) HIncrBy(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) HIncrByFloat(db uint32, args ...interface{}) (float64, error)
- func (b *Binlog) HKeys(db uint32, args ...interface{}) ([][]byte, error)
- func (b *Binlog) HLen(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) HMGet(db uint32, args ...interface{}) ([][]byte, error)
- func (b *Binlog) HMSet(db uint32, args ...interface{}) error
- func (b *Binlog) HSet(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) HSetNX(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) HVals(db uint32, args ...interface{}) ([][]byte, error)
- func (b *Binlog) Incr(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) IncrBy(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) IncrByFloat(db uint32, args ...interface{}) (float64, error)
- func (b *Binlog) Info() (string, error)
- func (b *Binlog) LIndex(db uint32, args ...interface{}) ([]byte, error)
- func (b *Binlog) LLen(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) LPop(db uint32, args ...interface{}) ([]byte, error)
- func (b *Binlog) LPush(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) LPushX(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) LRange(db uint32, args ...interface{}) ([][]byte, error)
- func (b *Binlog) LSet(db uint32, args ...interface{}) error
- func (b *Binlog) LTrim(db uint32, args ...interface{}) error
- func (b *Binlog) MGet(db uint32, args ...interface{}) ([][]byte, error)
- func (b *Binlog) MSet(db uint32, args ...interface{}) error
- func (b *Binlog) MSetNX(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) NewSnapshot() (*BinlogSnapshot, error)
- func (b *Binlog) PExpire(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) PExpireAt(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) PSetEX(db uint32, args ...interface{}) error
- func (b *Binlog) PTTL(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) Persist(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) RPop(db uint32, args ...interface{}) ([]byte, error)
- func (b *Binlog) RPush(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) RPushX(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) ReleaseSnapshot(sp *BinlogSnapshot)
- func (b *Binlog) Reset() error
- func (b *Binlog) Restore(db uint32, args ...interface{}) error
- func (b *Binlog) SAdd(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) SCard(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) SIsMember(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) SMembers(db uint32, args ...interface{}) ([][]byte, error)
- func (b *Binlog) SPop(db uint32, args ...interface{}) ([]byte, error)
- func (b *Binlog) SRandMember(db uint32, args ...interface{}) ([][]byte, error)
- func (b *Binlog) SRem(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) Set(db uint32, args ...interface{}) error
- func (b *Binlog) SetBit(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) SetEX(db uint32, args ...interface{}) error
- func (b *Binlog) SetNX(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) SetRange(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) SlotsInfo(db uint32, args ...interface{}) (map[uint32]int64, error)
- func (b *Binlog) SlotsMgrtOne(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) SlotsMgrtSlot(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) SlotsMgrtTagOne(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) SlotsMgrtTagSlot(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) SlotsRestore(db uint32, args ...interface{}) error
- func (b *Binlog) Strlen(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) TTL(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) Type(db uint32, args ...interface{}) (ObjectCode, error)
- func (b *Binlog) ZAdd(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) ZCard(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) ZGetAll(db uint32, args ...interface{}) ([][]byte, error)
- func (b *Binlog) ZIncrBy(db uint32, args ...interface{}) (float64, error)
- func (b *Binlog) ZRem(db uint32, args ...interface{}) (int64, error)
- func (b *Binlog) ZScore(db uint32, args ...interface{}) (float64, bool, error)
- type BinlogSnapshot
- type BufReader
- func (r *BufReader) Len() int
- func (r *BufReader) ReadByte() (byte, error)
- func (r *BufReader) ReadBytes(n int) ([]byte, error)
- func (r *BufReader) ReadFloat64() (float64, error)
- func (r *BufReader) ReadUvarint() (uint64, error)
- func (r *BufReader) ReadVarbytes() ([]byte, error)
- func (r *BufReader) ReadVarint() (int64, error)
- type BufWriter
- func (w *BufWriter) Bytes() []byte
- func (w *BufWriter) Len() int
- func (w *BufWriter) WriteByte(b byte) error
- func (w *BufWriter) WriteBytes(p []byte) error
- func (w *BufWriter) WriteFloat64(f float64) error
- func (w *BufWriter) WriteUvarint(v uint64) error
- func (w *BufWriter) WriteVarbytes(p []byte) error
- func (w *BufWriter) WriteVarint(v int64) error
- type Forward
- type ObjectCode
Constants ¶
View Source
const ( MetaCode = byte('#') DataCode = byte('&') )
View Source
const (
MaxExpireAt = 1e15
)
View Source
const (
MaxSlotNum = 1024
)
Variables ¶
View Source
var ( ErrNoSuchList = errors.Static("no such list") ErrOutOfRange = errors.Static("index out of range") )
View Source
var ( ErrMetaKey = errors.Static("invalid meta key") ErrDataKey = errors.Static("invalid data key") ErrNotMatched = errors.Static("unmatched raw bytes") ErrObjectCode = errors.Static("invalid object code") ErrObjectValue = errors.Static("invalid object value") ErrNotString = errors.Static("not string") ErrNotHash = errors.Static("not hash") ErrNotList = errors.Static("not list") ErrNotZSet = errors.Static("not zset") ErrNotSet = errors.Static("not set") )
View Source
var (
ErrClosed = errors.Static("binlog has been closed")
)
View Source
var (
ErrSnapClosed = errors.Static("binlog snapshot has been closed")
)
View Source
var (
ErrVarbytesLen = errors.Static("invalid varbytes length")
)
Functions ¶
func EncodeDataKeyPrefix ¶
func EncodeMetaKey ¶
func EncodeMetaKeyPrefixSlot ¶
func EncodeMetaKeyPrefixTag ¶
func ExpireAtToTTLms ¶
func FormatFloat ¶
func FormatFloatString ¶
func FormatUint ¶
func HashKeyToSlot ¶
func HashTagToSlot ¶
func ParseFloat ¶
func TTLmsToExpireAt ¶
func TTLsToExpireAt ¶
Types ¶
type Binlog ¶
type Binlog struct {
// contains filtered or unexported fields
}
func (*Binlog) CompactAll ¶
func (*Binlog) HIncrByFloat ¶
HINCRBYFLOAT key field delta
func (*Binlog) IncrByFloat ¶
INCRBYFLOAT key delta
func (*Binlog) NewSnapshot ¶
func (b *Binlog) NewSnapshot() (*BinlogSnapshot, error)
func (*Binlog) ReleaseSnapshot ¶
func (b *Binlog) ReleaseSnapshot(sp *BinlogSnapshot)
func (*Binlog) SRandMember ¶
SRANDMEMBER key [count]
func (*Binlog) SlotsMgrtOne ¶
SLOTSMGRTONE host port timeout key
func (*Binlog) SlotsMgrtSlot ¶
SLOTSMGRTSLOT host port timeout slot
func (*Binlog) SlotsMgrtTagOne ¶
SLOTSMGRTTAGONE host port timeout key
func (*Binlog) SlotsMgrtTagSlot ¶
SLOTSMGRTTAGSLOT host port timeout slot
func (*Binlog) SlotsRestore ¶
SLOTSRESTORE key ttlms value [key ttlms value ...]
func (*Binlog) Type ¶
func (b *Binlog) Type(db uint32, args ...interface{}) (ObjectCode, error)
TYPE key
type BinlogSnapshot ¶
type BinlogSnapshot struct {
// contains filtered or unexported fields
}
func (*BinlogSnapshot) Close ¶
func (s *BinlogSnapshot) Close()
func (*BinlogSnapshot) LoadObjCron ¶
type BufReader ¶
type BufReader struct {
// contains filtered or unexported fields
}
func NewBufReader ¶
func (*BufReader) ReadFloat64 ¶
func (*BufReader) ReadUvarint ¶
func (*BufReader) ReadVarbytes ¶
func (*BufReader) ReadVarint ¶
type BufWriter ¶
type BufWriter struct {
// contains filtered or unexported fields
}
func NewBufWriter ¶
func (*BufWriter) WriteBytes ¶
func (*BufWriter) WriteFloat64 ¶
func (*BufWriter) WriteUvarint ¶
func (*BufWriter) WriteVarbytes ¶
func (*BufWriter) WriteVarint ¶
type ObjectCode ¶
type ObjectCode byte
const ( StringCode ObjectCode = 'K' HashCode ObjectCode = 'H' ListCode ObjectCode = 'L' ZSetCode ObjectCode = 'Z' SetCode ObjectCode = 'S' )
func (ObjectCode) String ¶
func (c ObjectCode) String() string
Click to show internal directories.
Click to hide internal directories.