db

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Separator of the key segment
	Separator = ":"
	// ObjectEncodingLength indecate current object marshaled length
	ObjectEncodingLength = 42
)
View Source
const (
	ObjectEncodingRaw = ObjectEncoding(iota)
	ObjectEncodingInt
	ObjectEncodingHT
	ObjectEncodingZipmap
	ObjectEncodingLinkedlist
	ObjectEncodingZiplist
	ObjectEncodingIntset
	ObjectEncodingSkiplist
	ObjectEncodingEmbstr
	ObjectEncodingQuicklist
)

Encoding values, see https://github.com/antirez/redis/blob/unstable/src/server.h#L581

View Source
const (
	ObjectString = ObjectType(iota)
	ObjectList
	ObjectSet
	ObjectZSet
	ObjectHash
)

Object types, see https://github.com/antirez/redis/blob/unstable/src/server.h#L461

Variables

View Source
var (
	// ErrTypeMismatch indicates object type of key is not as expect
	ErrTypeMismatch = errors.New("type mismatch")

	// ErrKeyNotFound key not exist
	ErrKeyNotFound = errors.New("key not found")

	// ErrInteger valeu is not interge
	ErrInteger = errors.New("value is not an integer or out of range")

	// ErrPrecision list index reach precision limitatin
	ErrPrecision = errors.New("list reaches precision limitation, rebalance now")

	// ErrOutOfRange index/offset out of range
	ErrOutOfRange = errors.New("error index/offset out of range")

	// ErrInvalidLength data length is invalid for unmarshaler"
	ErrInvalidLength = errors.New("error data length is invalid for unmarshaler")

	// ErrEncodingMismatch object encoding type
	ErrEncodingMismatch = errors.New("error object encoding type")

	// ErrStorageRetry storage err and try again later
	ErrStorageRetry = errors.New("Storage err and try again later")

	//ErrSetNilValue means the value corresponding to key is a non-zero value
	ErrSetNilValue = errors.New("The value corresponding to key is a non-zero value")

	// IsErrNotFound returns true if the key is not found, otherwise return false
	IsErrNotFound = store.IsErrNotFound

	// IsRetryableError returns true if the error is temporary and can be retried
	IsRetryableError = store.IsRetryableError

	// IsConflictError return true if the error is conflict
	IsConflictError = store.IsConflictError

	NilValue = []byte{0}
)
View Source
var SetNilValue = []byte{0}

SetNilValue is the value set to a tikv key for tikv do not support a real empty value

Functions

func BatchGetValues

func BatchGetValues(txn *Transaction, keys [][]byte) ([][]byte, error)

BatchGetValues issues batch requests to get values

func DataKey

func DataKey(db *DB, key []byte) []byte

DataKey builds a datakey from a redis key

func DecodeFloat64

func DecodeFloat64(d []byte) float64

DecodeFloat64 decode the float64 object from binary

func DecodeInt64

func DecodeInt64(b []byte) int64

DecodeInt64 decode the int64 object from binary

func EncodeFloat64

func EncodeFloat64(v float64) ([]byte, error)

EncodeFloat64 encode the float64 object to binary

func EncodeHashMeta added in v0.6.0

func EncodeHashMeta(meta *HashMeta) []byte

EncodeHashMeta encodes meta data into byte slice

func EncodeInt64

func EncodeInt64(v int64) ([]byte, error)

EncodeInt64 encode the int64 object to binary

func EncodeObject

func EncodeObject(obj *Object) []byte

EncodeObject encode the object to binary

func IsExpired

func IsExpired(obj *Object, now int64) bool

IsExpired judge object expire through now

func MetaKey

func MetaKey(db *DB, key []byte) []byte

MetaKey build to metakey from a redis key

func Now

func Now() int64

Now returns the current unix nano timestamp.

func PutZList

func PutZList(txn *Transaction, metakey []byte) error

PutZList should be called after ZList created

func RemoveRepByMap added in v0.6.0

func RemoveRepByMap(members [][]byte) [][]byte

RemoveRepByMap filters duplicate elements through the map's unique primary key feature

func RemoveZTKey

func RemoveZTKey(txn *Transaction, metakey []byte) error

RemoveZTKey remove an metakey from ZT

func StartExpire

func StartExpire(db *DB, conf *conf.Expire)

StartExpire get leader from db

func StartGC

func StartGC(db *DB, conf *conf.GC)

StartGC start gc 1.获取leader许可 2.leader 执行清理任务

func StartTiKVGC added in v0.6.0

func StartTiKVGC(db *DB, tikvCfg *conf.TiKVGC)

StartTiKVGC start tikv gcwork

func StartZT

func StartZT(db *DB, conf *conf.ZT)

StartZT start ZT fill in the queue(channel), and start the worker to consume.

func UUID

func UUID() []byte

UUID allocates an unique object ID.

func UUIDString

func UUIDString(id []byte) string

UUIDString returns canonical string representation of UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

func ZSetScorePrefix added in v0.6.0

func ZSetScorePrefix(dkey []byte) []byte

ZSetScorePrefix builds a score key prefix from a redis key

Types

type DB

type DB struct {
	Namespace string
	ID        DBID
	// contains filtered or unexported fields
}

DB is a redis compatible data structure storage

func (*DB) Begin

func (db *DB) Begin() (*Transaction, error)

Begin a transaction

func (*DB) Prefix

func (db *DB) Prefix() []byte

Prefix returns the prefix of a DB object

type DBID

type DBID byte

DBID is the redis database ID

func (DBID) Bytes

func (id DBID) Bytes() []byte

Bytes DBID returns a byte slice

func (DBID) String

func (id DBID) String() string

String returns the string format of DBID

type Hash

type Hash struct {
	// contains filtered or unexported fields
}

Hash implements the hashtable

func GetHash

func GetHash(txn *Transaction, key []byte) (*Hash, error)

GetHash returns a hash object, create new one if nonexists

func (*Hash) Exists added in v0.6.0

func (hash *Hash) Exists() bool

Exists check hashes exist

func (*Hash) HDel

func (hash *Hash) HDel(fields [][]byte) (int64, error)

HDel removes the specified fields from the hash stored at key

func (*Hash) HExists

func (hash *Hash) HExists(field []byte) (bool, error)

HExists returns if field is an existing field in the hash stored at key

func (*Hash) HGet

func (hash *Hash) HGet(field []byte) ([]byte, error)

HGet returns the value associated with field in the hash stored at key

func (*Hash) HGetAll

func (hash *Hash) HGetAll() ([][]byte, [][]byte, error)

HGetAll returns all fields and values of the hash stored at key

func (*Hash) HIncrBy

func (hash *Hash) HIncrBy(field []byte, v int64) (int64, error)

HIncrBy increments the number stored at field in the hash stored at key by increment

func (*Hash) HIncrByFloat

func (hash *Hash) HIncrByFloat(field []byte, v float64) (float64, error)

HIncrByFloat increment the specified field of a hash stored at key, and representing a floating point number, by the specified increment

func (*Hash) HLen

func (hash *Hash) HLen() (int64, error)

HLen returns the number of fields contained in the hash stored at key

func (*Hash) HMGet

func (hash *Hash) HMGet(fields [][]byte) ([][]byte, error)

HMGet returns the values associated with the specified fields in the hash stored at key

func (*Hash) HMSet

func (hash *Hash) HMSet(fields, values [][]byte) error

HMSet sets the specified fields to their respective values in the hash stored at key

func (*Hash) HScan added in v0.6.0

func (hash *Hash) HScan(cursor []byte, f func(key, val []byte) bool) error

HScan incrementally iterate hash fields and associated values

func (*Hash) HSet

func (hash *Hash) HSet(field []byte, value []byte) (int, error)

HSet sets field in the hash stored at key to value

func (*Hash) HSetNX

func (hash *Hash) HSetNX(field []byte, value []byte) (int, error)

HSetNX sets field in the hash stored at key to value, only if field does not yet exist

type HashMeta

type HashMeta struct {
	Object
}

HashMeta is the meta data of the hashtable

func DecodeHashMeta added in v0.6.0

func DecodeHashMeta(b []byte) (*HashMeta, error)

DecodeHashMeta decode meta data into meta field

type Iterator

type Iterator store.Iterator

Iterator store.Iterator

type Kv

type Kv struct {
	// contains filtered or unexported fields
}

Kv supplies key releated operations

func GetKv

func GetKv(txn *Transaction) *Kv

GetKv returns a Kv object

func (*Kv) Delete

func (kv *Kv) Delete(keys [][]byte) (int64, error)

Delete specific keys, ignore if non exist

func (*Kv) Exists

func (kv *Kv) Exists(keys [][]byte) (int64, error)

Exists check if the given keys exist

func (*Kv) ExpireAt

func (kv *Kv) ExpireAt(key []byte, at int64) error

ExpireAt set a timeout on key

func (*Kv) FlushAll

func (kv *Kv) FlushAll(ctx context.Context) error

FlushAll clean up all databases.

func (*Kv) FlushDB

func (kv *Kv) FlushDB(ctx context.Context) error

FlushDB clear current db.

func (*Kv) Keys

func (kv *Kv) Keys(start []byte, f func(key []byte) bool) error

Keys iterator all keys in db

func (*Kv) RandomKey

func (kv *Kv) RandomKey() ([]byte, error)

RandomKey return a key from current db randomly Now we use an static length(64) to generate the key spaces, it means it is random for keys that len(key) <= 64, it is enough for most cases

func (*Kv) Touch added in v0.6.0

func (kv *Kv) Touch(keys [][]byte) (int64, error)

Touch alters the last access time of a key(s)

type LList

type LList struct {
	LListMeta
	// contains filtered or unexported fields
}

LList is a distributed object that works like a double link list {Object schema}:{index} -> value

func (*LList) Destory

func (l *LList) Destory() error

Destory the list

func (*LList) Exist

func (l *LList) Exist() bool

Exist checks if a list exists

func (*LList) Index

func (l *LList) Index(n int64) (data []byte, err error)

Index returns the element at index n in the list stored at key

func (*LList) Insert

func (l *LList) Insert(pivot, v []byte, before bool) error

Insert value in the list stored at key either before or after the reference value pivot 1. pivot berfore/ pivot/ next --> real indexs

func (*LList) LPop

func (l *LList) LPop() (data []byte, err error)

LPop returns and deletes the left most element 0. calculate data key 1. iterate to last value 2. get the key and call kv delete 3. modify the new index in meta

func (*LList) LPush

func (l *LList) LPush(data ...[]byte) (err error)

LPush adds new elements to the left 1. calculate index 2. encode object and call kv 3. modify the new index in meta

func (*LList) LRem

func (l *LList) LRem(v []byte, n int64) (int, error)

LRem removes the first count occurrences of elements equal to value from the list stored at key

func (*LList) LTrim

func (l *LList) LTrim(start int64, stop int64) error

LTrim an existing list so that it will contain only the specified range of elements specified

func (*LList) Length

func (l *LList) Length() int64

Length returns length of the list

func (*LList) RPop

func (l *LList) RPop() ([]byte, error)

RPop returns and deletes the right most element

func (*LList) RPush

func (l *LList) RPush(data ...[]byte) (err error)

RPush pushes elements into right side of list

func (*LList) Range

func (l *LList) Range(left, right int64) (value [][]byte, err error)

Range returns the elements in [left, right]

func (*LList) Set

func (l *LList) Set(n int64, data []byte) error

Set the index object with given value, return ErrIndex on out of range error.

type LListMeta

type LListMeta struct {
	Object
	Len    int64
	Lindex float64
	Rindex float64
}

LListMeta keeps all meta info of a list object after marshaled, listmeta raw data should organized like below |----object 34----| |------len 8------| |----linedx 8-----| |----rindex 8-----|

func (*LListMeta) Marshal

func (l *LListMeta) Marshal() []byte

Marshal encodes meta data into byte slice

func (*LListMeta) Unmarshal

func (l *LListMeta) Unmarshal(obj *Object, b []byte) (err error)

Unmarshal parses meta data into meta field

type Lease

type Lease struct {
	Object
	TouchedAt int64
}

Lease is an object that can be associated with other objects those can share the same ttl of the lease

type List

type List interface {
	Index(n int64) (data []byte, err error)
	Insert(pivot, v []byte, before bool) error
	LPop() (data []byte, err error)
	LPush(data ...[]byte) (err error)
	RPop() (data []byte, err error)
	RPush(data ...[]byte) (err error)
	Range(left, right int64) (value [][]byte, err error)
	LRem(v []byte, n int64) (int, error)
	Set(n int64, data []byte) error
	LTrim(start int64, stop int64) error
	Length() int64
	Exist() bool
	Destory() error
}

List defines the list interface

func GetLList

func GetLList(txn *Transaction, metaKey []byte, obj *Object, val []byte) (List, error)

GetLList returns a list

func GetList

func GetList(txn *Transaction, key []byte, opts ...ListOption) (List, error)

GetList returns a List object, it creates a new one if the key does not exist, when UseZip() is set, it will create a ziplist instead of a linklist

func NewLList

func NewLList(txn *Transaction, key []byte) (List, error)

NewLList creates a new list

func NewZList

func NewZList(txn *Transaction, key []byte) (List, error)

NewZList create new list object ,the key is not checked for presence

type ListOption

type ListOption func(o *listOption)

ListOption customize how to get a list

func UseZip

func UseZip() ListOption

UseZip will create a ziplist if set when the key is missing

type MemberScore added in v0.6.0

type MemberScore struct {
	Member string
	Score  float64
}

type Object

type Object struct {
	ID        []byte
	Type      ObjectType     //refer to redis
	Encoding  ObjectEncoding //refer to redis
	CreatedAt int64
	UpdatedAt int64
	ExpireAt  int64
}

Object meta schema

Layout {DB}:{TAG}:{Key}
DB     [0-255]
Key    Usersapce key
TAG    M(Meta), D(Data)

Object data schema

Layout: {DB}:{TAG}:{ID}:{Others}
ID     Object ID, ID is not used for meta

String schema (associated value with meta)

Layout: {DB}:M:{key}

func DecodeObject

func DecodeObject(b []byte) (obj *Object, err error)

DecodeObject decode the object from binary

func (*Object) String

func (obj *Object) String() string

String representation of an object

type ObjectEncoding

type ObjectEncoding byte

ObjectEncoding is the encoding type of an object

func (ObjectEncoding) String

func (enc ObjectEncoding) String() string

String representation of ObjectEncoding

type ObjectType

type ObjectType byte

ObjectType is the type of a data structure

func (ObjectType) String

func (t ObjectType) String() string

String representation of object type

type RedisStore

type RedisStore struct {
	store.Storage
	// contains filtered or unexported fields
}

RedisStore wraps store.Storage

func Open

func Open(conf *conf.TiKV) (*RedisStore, error)

Open a storage instance

func (*RedisStore) Close

func (rds *RedisStore) Close() error

Close the storage instance

func (*RedisStore) DB

func (rds *RedisStore) DB(namesapce string, id int) *DB

DB returns a DB object with sepcific ID

type Set

type Set struct {
	// contains filtered or unexported fields
}

Set implements the set data structure

func GetSet

func GetSet(txn *Transaction, key []byte) (*Set, error)

GetSet returns a set object, create new one if nonexists

func (*Set) Exists added in v0.6.0

func (set *Set) Exists() bool

Exists check set exist

func (*Set) Iter added in v0.6.0

func (set *Set) Iter() (*SetIter, error)

Iter returns the SetIter object

func (*Set) SAdd

func (set *Set) SAdd(members ...[]byte) (int64, error)

SAdd adds the specified members to the set stored at key

func (*Set) SCard added in v0.6.0

func (set *Set) SCard() (int64, error)

SCard returns the set cardinality (number of elements) of the set stored at key

func (*Set) SIsmember added in v0.6.0

func (set *Set) SIsmember(member []byte) (int64, error)

SIsmember returns if member is a member of the set stored at key

func (*Set) SMembers

func (set *Set) SMembers() ([][]byte, error)

SMembers returns all the members of the set value stored at key

func (*Set) SMove added in v0.6.0

func (set *Set) SMove(destination []byte, member []byte) (int64, error)

SMove movies member from the set at source to the set at destination

func (*Set) SPop added in v0.6.0

func (set *Set) SPop(count int64) ([][]byte, error)

SPop removes and returns one or more random elements from the set value store at key.

func (*Set) SRem added in v0.6.0

func (set *Set) SRem(members [][]byte) (int64, error)

SRem removes the specified members from the set stored at key

type SetIter added in v0.6.0

type SetIter struct {
	Iter   Iterator
	Prefix []byte
}

SetIter is the struct of Iterator and prefix

func (*SetIter) Valid added in v0.6.0

func (siter *SetIter) Valid() bool

Valid judgies whether the key directed by iter has the same prifix

func (*SetIter) Value added in v0.6.0

func (siter *SetIter) Value() []byte

Value returns the member pointed by iter

type SetMeta

type SetMeta struct {
	Object
	Len int64
}

SetMeta is the meta data of the set

type String

type String struct {
	Meta StringMeta
	// contains filtered or unexported fields
}

String object operate tikv

func GetString

func GetString(txn *Transaction, key []byte) (*String, error)

GetString return string object , if key is exist , object load meta otherwise object is null if key is not exist and err is not found otherwise return err

func NewString

func NewString(txn *Transaction, key []byte) *String

NewString create new string object

func (*String) Append

func (s *String) Append(value []byte) (int, error)

Append appends a value to key

func (*String) BitCount added in v0.6.0

func (s *String) BitCount(begin, end int) (int, error)

BitCount counts the number of set bits (population counting) in a string.

func (*String) BitOpAnd added in v0.6.0

func (s *String) BitOpAnd()

func (*String) BitOpNot added in v0.6.0

func (s *String) BitOpNot()

func (*String) BitOpOr added in v0.6.0

func (s *String) BitOpOr()

func (*String) BitOpXor added in v0.6.0

func (s *String) BitOpXor()

func (*String) BitPos added in v0.6.0

func (s *String) BitPos(bit, begin, end int) (int, error)

BitPos finds first bit set or clear in a string

func (*String) Exist

func (s *String) Exist() bool

Exist returns ture if key exist

func (*String) Get

func (s *String) Get() ([]byte, error)

Get the value information for the key from db

func (*String) GetBit added in v0.6.0

func (s *String) GetBit(offset int) (int, error)

GetBit key offset bitvalye offset / 8 > the index of value offset mod 8 +1

func (*String) GetRange

func (s *String) GetRange(start, end int) []byte

GetRange returns string from the absolute of start to the absolute of end

func (*String) GetSet

func (s *String) GetSet(value []byte) ([]byte, error)

GetSet returns old value ,value replace old value

func (*String) Incr

func (s *String) Incr(delta int64) (int64, error)

Incr increments the integer value by the given amount the old value must be integer

func (*String) Incrf

func (s *String) Incrf(delta float64) (float64, error)

Incrf increments the float value by the given amount the old value must be float

func (*String) Len

func (s *String) Len() (int, error)

Len value len

func (*String) Set

func (s *String) Set(val []byte, expire ...int64) error

Set set the string value of a key the num of expire slice is not zero and expire[0] is not zero ,the key add exprie queue otherwise the delete expire queue

func (*String) SetBit added in v0.6.0

func (s *String) SetBit(offset, on int) (int, error)

SetBit key offset bitvalue return the off postion of value

func (*String) SetRange

func (s *String) SetRange(offset int64, value []byte) ([]byte, error)

SetRange overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.

type StringMeta

type StringMeta struct {
	Object
	Value []byte
}

StringMeta string meta msg

type Transaction

type Transaction struct {
	// contains filtered or unexported fields
}

Transaction supplies transaction for data structures

func (*Transaction) Commit

func (txn *Transaction) Commit(ctx context.Context) error

Commit a transaction

func (*Transaction) Destory

func (txn *Transaction) Destory(obj *Object, key []byte) error

Destory the object

func (*Transaction) Hash

func (txn *Transaction) Hash(key []byte) (*Hash, error)

Hash returns a hash object

func (*Transaction) Kv

func (txn *Transaction) Kv() *Kv

Kv returns a kv object

func (*Transaction) List

func (txn *Transaction) List(key []byte, opts ...ListOption) (List, error)

List return a lists object, a new list is created if the key dose not exist.

func (*Transaction) LockKeys

func (txn *Transaction) LockKeys(keys ...[]byte) error

LockKeys tries to lock the entries with the keys in KV store.

func (*Transaction) Object

func (txn *Transaction) Object(key []byte) (*Object, error)

Object returns the object associated with the key

func (*Transaction) Rollback

func (txn *Transaction) Rollback() error

Rollback a transaction

func (*Transaction) Set

func (txn *Transaction) Set(key []byte) (*Set, error)

Set returns a set object

func (*Transaction) String

func (txn *Transaction) String(key []byte) (*String, error)

String returns a string object, but the object is unsafe, maybe the object is expire,or not exist

func (*Transaction) Strings

func (txn *Transaction) Strings(keys [][]byte) ([]*String, error)

Strings returns a slice of String

func (*Transaction) ZSet added in v0.6.0

func (txn *Transaction) ZSet(key []byte) (*ZSet, error)

ZSet returns a zset object

type ZList

type ZList struct {
	Object
	// contains filtered or unexported fields
}

ZList ZListMeta defined zip list, with only objectMeta info.

func GetZList

func GetZList(txn *Transaction, metaKey []byte, obj *Object, val []byte) (*ZList, error)

GetZList generate List objectm with auto reation, if zip is true, zipped list will be choose

func (*ZList) Destory

func (l *ZList) Destory() error

Destory the zlist

func (*ZList) Exist

func (l *ZList) Exist() bool

Exist if zlist is effective return true ,otherwise return false

func (*ZList) Index

func (l *ZList) Index(n int64) (data []byte, err error)

Index return the value at index

func (*ZList) Insert

func (l *ZList) Insert(pivot, v []byte, before bool) error

Insert v before/after pivot in zlist

func (*ZList) LPop

func (l *ZList) LPop() (data []byte, err error)

LPop return and delete the left most element

func (*ZList) LPush

func (l *ZList) LPush(data ...[]byte) (err error)

LPush append new elements to the object values

func (*ZList) LRem

func (l *ZList) LRem(v []byte, n int64) (int, error)

LRem begin delete the count of n key from v

func (*ZList) LTrim

func (l *ZList) LTrim(start int64, stop int64) error

LTrim get keys from start index to stop index

func (*ZList) Length

func (l *ZList) Length() int64

Length return z list length

func (*ZList) Marshal

func (l *ZList) Marshal() ([]byte, error)

Marshal encode zlist into byte slice

func (*ZList) RPop

func (l *ZList) RPop() ([]byte, error)

RPop return and delete the right most element

func (*ZList) RPush

func (l *ZList) RPush(data ...[]byte) (err error)

RPush insert data befroe object values

func (*ZList) Range

func (l *ZList) Range(left, right int64) (value [][]byte, err error)

Range return the elements in [left, right]

func (*ZList) Set

func (l *ZList) Set(n int64, data []byte) error

Set the index object with given value, return ErrIndex on out of range error.

func (*ZList) TransferToLList

func (l *ZList) TransferToLList(dbns []byte, dbid DBID, key []byte) (*LList, error)

TransferToLList create an llist and put values into llist from zlist, LList will inheritance information from ZList

func (*ZList) Unmarshal

func (l *ZList) Unmarshal(obj *Object, b []byte) (err error)

Unmarshal parse meta data into meta field

type ZSet added in v0.6.0

type ZSet struct {
	// contains filtered or unexported fields
}

ZSet implements the the sorted set

func GetZSet added in v0.6.0

func GetZSet(txn *Transaction, key []byte) (*ZSet, error)

GetZSet returns a sorted set, create new one if don't exists

func (*ZSet) Exist added in v0.6.0

func (zset *ZSet) Exist() bool

func (*ZSet) MGet added in v0.6.0

func (zset *ZSet) MGet(members [][]byte) ([][]byte, error)

func (*ZSet) ZAdd added in v0.6.0

func (zset *ZSet) ZAdd(members [][]byte, scores []float64) (int64, error)

func (*ZSet) ZAnyOrderRange added in v0.6.0

func (zset *ZSet) ZAnyOrderRange(start int64, stop int64, withScore bool, positiveOrder bool) ([][]byte, error)

func (*ZSet) ZAnyOrderRangeByScore added in v0.6.0

func (zset *ZSet) ZAnyOrderRangeByScore(startScore float64, startInclude bool,
	stopScore float64, stopInclude bool,
	withScore bool,
	offset int64, count int64,
	positiveOrder bool) ([][]byte, error)

ZAnyOrderRangeByScore returns the items of a zset in specific order

func (*ZSet) ZCard added in v0.6.0

func (zset *ZSet) ZCard() int64

func (*ZSet) ZRem added in v0.6.0

func (zset *ZSet) ZRem(members [][]byte) (int64, error)

func (*ZSet) ZScore added in v0.6.0

func (zset *ZSet) ZScore(member []byte) ([]byte, error)

type ZSetMeta added in v0.6.0

type ZSetMeta struct {
	Object
	Len int64
}

ZSetMeta is the meta data of the sorted set

Directories

Path Synopsis
Package zlistproto is a generated protocol buffer package.
Package zlistproto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL