Documentation
¶
Index ¶
- type Client
- func (c *Client) Auth(password string) error
- func (c *Client) BitCount(key string, start, end int64) (int64, error)
- func (c *Client) CountBit(key string, start, size int64) (int64, error)
- func (c *Client) DBSize() (int64, error)
- func (c *Client) Del(key string) error
- func (c *Client) Do(args ...interface{}) (v Values, err0 error)
- func (c *Client) Exists(key string) (bool, error)
- func (c *Client) Expire(key string, ttl time.Duration) (bool, error)
- func (c *Client) Get(key string) (Value, error)
- func (c *Client) GetBit(key string, offset int64) (bool, error)
- func (c *Client) GetConn() (*Conn, error)
- func (c *Client) GetSet(key string, value Value) (Value, error)
- func (c *Client) HClear(name string) error
- func (c *Client) HDel(name, key string) (bool, error)
- func (c *Client) HExists(name, key string) (bool, error)
- func (c *Client) HGet(name, key string) (Value, error)
- func (c *Client) HGetAll(name string) (map[string]Value, error)
- func (c *Client) HIncr(name, key string, num int64) (int64, error)
- func (c *Client) HKeys(name, keyStart, keyEnd string, limit int64) ([]string, error)
- func (c *Client) HKeysRangeAll(name, keyStart, keyEnd string, limit int64, cb func(string) error) error
- func (c *Client) HList(nameStart, nameEnd string, limit int64) ([]string, error)
- func (c *Client) HListRangeAll(nameStart, nameEnd string, limit int64, cb func(string) error) error
- func (c *Client) HRList(nameStart, nameEnd string, limit int64) ([]string, error)
- func (c *Client) HRListRangeAll(nameStart, nameEnd string, limit int64, cb func(string) error) error
- func (c *Client) HRScan(name string, keyStart, keyEnd string, limit int64) (map[string]Value, error)
- func (c *Client) HRScanRangeAll(name string, keyStart, keyEnd string, limit int64, ...) error
- func (c *Client) HScan(name string, keyStart, keyEnd string, limit int64) (map[string]Value, error)
- func (c *Client) HScanRangeAll(name string, keyStart, keyEnd string, limit int64, ...) error
- func (c *Client) HSet(name, key string, value Value) (bool, error)
- func (c *Client) HSize(name string) (int64, error)
- func (c *Client) Incr(key string, num int64) (int64, error)
- func (c *Client) Info() ([]string, error)
- func (c *Client) Keys(keyStart, keyEnd string, limit int64) ([]string, error)
- func (c *Client) KeysRangeAll(keyStart, keyEnd string, limit int64, cb func(string) error) error
- func (c *Client) MultiDel(key ...string) error
- func (c *Client) MultiGet(key ...string) (map[string]Value, error)
- func (c *Client) MultiHDel(name string, key ...string) error
- func (c *Client) MultiHGet(name string, key ...string) (map[string]Value, error)
- func (c *Client) MultiHSet(name string, kvs map[string]Value) error
- func (c *Client) MultiSet(kvs map[string]Value) (err error)
- func (c *Client) MultiZDel(name string, key ...string) error
- func (c *Client) MultiZGet(name string, key ...string) (map[string]int64, error)
- func (c *Client) MultiZSet(name string, kvs map[string]int64) error
- func (c *Client) PutConn(conn *Conn)
- func (c *Client) QBack(key string) (Value, error)
- func (c *Client) QClear(name string) error
- func (c *Client) QFront(key string) (Value, error)
- func (c *Client) QGet(key string, index int64) (Value, error)
- func (c *Client) QList(nameStart, nameEnd string, limit int64) ([]string, error)
- func (c *Client) QListRangeAll(nameStart, nameEnd string, limit int64, cb func(string) error) error
- func (c *Client) QPopBack(name string, size int64) (Values, error)
- func (c *Client) QPopFront(name string, size int64) (Values, error)
- func (c *Client) QPushBack(name string, item ...Value) (int64, error)
- func (c *Client) QPushFront(name string, item ...Value) (int64, error)
- func (c *Client) QRList(nameStart, nameEnd string, limit int64) ([]string, error)
- func (c *Client) QRListRangeAll(nameStart, nameEnd string, limit int64, cb func(string) error) error
- func (c *Client) QRange(name string, offset, limit int) (Values, error)
- func (c *Client) QSet(key string, index int64, value Value) error
- func (c *Client) QSize(name string) (int64, error)
- func (c *Client) QSlice(name string, begin, end int) (Values, error)
- func (c *Client) QTrimBack(name string, size int) (int64, error)
- func (c *Client) QTrimFront(name string, size int) (int64, error)
- func (c *Client) RKeys(keyStart, keyEnd string, limit int64) ([]string, error)
- func (c *Client) RKeysRangeAll(keyStart, keyEnd string, limit int64, cb func(string) error) error
- func (c *Client) RScan(keyStart, keyEnd string, limit int64) (map[string]Value, error)
- func (c *Client) RScanRangeAll(keyStart, keyEnd string, limit int64, cb func(string, Value) error) error
- func (c *Client) Scan(keyStart, keyEnd string, limit int64) (map[string]Value, error)
- func (c *Client) ScanRangeAll(keyStart, keyEnd string, limit int64, cb func(string, Value) error) error
- func (c *Client) Set(key string, value Value) error
- func (c *Client) SetBit(key string, offset int64, value bool) (bool, error)
- func (c *Client) SetNX(key string, value Value) (bool, error)
- func (c *Client) SetX(key string, value Value, ttl time.Duration) error
- func (c *Client) StrLen(key string) (int64, error)
- func (c *Client) SubStr(key string, start int64, size int64) (string, error)
- func (c *Client) TTL(key string) (time.Duration, error)
- func (c *Client) ZAvg(name string, scoreStart, scoreEnd int64) (int64, error)
- func (c *Client) ZClear(name string) error
- func (c *Client) ZCount(name string, start, end string) (int64, error)
- func (c *Client) ZDel(name, key string) error
- func (c *Client) ZExists(name, key string) (bool, error)
- func (c *Client) ZGet(name, key string) (int64, error)
- func (c *Client) ZIncr(name string, key string, num int64) (int64, error)
- func (c *Client) ZKeys(name string, keyStart string, scoreStart, scoreEnd int64, limit int64) ([]string, error)
- func (c *Client) ZKeysRangAll(name string, keyStart string, scoreStart, scoreEnd int64, limit int64, ...) error
- func (c *Client) ZList(nameStart, nameEnd string, limit int64) ([]string, error)
- func (c *Client) ZListRangAll(nameStart, nameEnd string, limit int64, cb func(string) error) error
- func (c *Client) ZPopBack(name string, limit int64) (map[string]int64, error)
- func (c *Client) ZPopFront(name string, limit int64) (map[string]int64, error)
- func (c *Client) ZRList(nameStart, nameEnd string, limit int64) ([]string, error)
- func (c *Client) ZRListRangAll(nameStart, nameEnd string, limit int64, cb func(string) error) error
- func (c *Client) ZRRange(name string, offset, limit int64) (map[string]int64, error)
- func (c *Client) ZRRank(name, key string) (int64, error)
- func (c *Client) ZRScan(name string, keyStart string, scoreStart, scoreEnd int64, limit int64) (map[string]int64, error)
- func (c *Client) ZRange(name string, offset, limit int64) (map[string]int64, error)
- func (c *Client) ZRank(name, key string) (int64, error)
- func (c *Client) ZRemRangeByRank(name string, start, end int64) error
- func (c *Client) ZRemRangeByScore(name string, start, end int64) error
- func (c *Client) ZScan(name string, keyStart string, scoreStart, scoreEnd int64, limit int64) (map[string]int64, error)
- func (c *Client) ZSet(name, key string, score int64) error
- func (c *Client) ZSize(name string) (int64, error)
- func (c *Client) ZSum(name string, scoreStart, scoreEnd int64) (int64, error)
- type Conn
- type Option
- type Value
- func (v Value) Bool() bool
- func (v Value) Bytes() []byte
- func (v Value) Duration() time.Duration
- func (v Value) Equal(y Value) bool
- func (v Value) Float() float64
- func (v Value) Int() int64
- func (v Value) IsEmpty() bool
- func (v Value) String() string
- func (v Value) Uint() uint64
- func (v Value) UnJson(obj interface{}) error
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client connected client
func (*Client) Auth ¶
Auth password Available since: 1.7.0.0 Authenticate the connection. Warning: The password is sent in plain-text over the network!
func (*Client) BitCount ¶
BitCount Count the number of set bits (population counting) in a string. Like Redis's bitcount.
func (*Client) CountBit ¶
CountBit Count the number of set bits (population counting) in a string. Like Redis's bitcount.
func (*Client) DBSize ¶
DBSize Return the approximate size of the database, in bytes. If compression is enabled, the size will be of the compressed data.
func (*Client) HDel ¶
HDel Delete specified key of a hashmap. To delete the whole hashmap, use hclear.
func (*Client) HIncr ¶
HIncr Since 1.7.0.1, *incr methods return error if value cannot be converted to integer. Increment the number stored at key in a hashmap by num. The num argument could be a negative integer. The old number is first converted to an integer before increment, assuming it was stored as literal integer.
func (*Client) HKeys ¶
HKeys List keys of a hashmap in range (keyStart, keyEnd]. ("", ""] means no range limit.
func (*Client) HKeysRangeAll ¶
func (c *Client) HKeysRangeAll(name, keyStart, keyEnd string, limit int64, cb func(string) error) error
HKeysRangeAll Like hkeys, The whole range
func (*Client) HList ¶
HList List hashmap names in range (nameStart, nameEnd]. ("", ""] means no range limit. Refer to scan command for more information about how it work.
func (*Client) HListRangeAll ¶
HListRangeAll Like hlist, The whole range
func (*Client) HRListRangeAll ¶
func (c *Client) HRListRangeAll(nameStart, nameEnd string, limit int64, cb func(string) error) error
HRListRangeAll Like hrlist, The whole range
func (*Client) HRScan ¶
func (c *Client) HRScan(name string, keyStart, keyEnd string, limit int64) (map[string]Value, error)
HRScan Like hscan, but in reverse order.
func (*Client) HRScanRangeAll ¶
func (c *Client) HRScanRangeAll(name string, keyStart, keyEnd string, limit int64, cb func(string, Value) error) error
HRScanRangeAll Like hrscan, The whole range
func (*Client) HScan ¶
HScan List key-value pairs of a hashmap with keys in range (keyStart, keyEnd]. ("", ""] means no range limit. Refer to scan command for more information about how it work.
func (*Client) HScanRangeAll ¶
func (c *Client) HScanRangeAll(name string, keyStart, keyEnd string, limit int64, cb func(string, Value) error) error
HScanRangeAll Like hscan, The whole range
func (*Client) Incr ¶
Incr Since 1.7.0.1, *incr methods return error if value cannot be converted to integer. Increment the number stored at key by num. The num argument could be a negative integer. The old number is first converted to an integer before increment, assuming it was stored as literal integer.
func (*Client) KeysRangeAll ¶
KeysRangeAll Like keys, The whole range
func (*Client) MultiHGet ¶
MultiHGet Get the values related to the specified multiple keys of a hashmap.
func (*Client) MultiHSet ¶
MultiHSet Set multiple key-value pairs(kvs) of a hashmap in one method call.
func (*Client) MultiZGet ¶
MultiZGet Get the values related to the specified multiple keys of a zset.
func (*Client) MultiZSet ¶
MultiZSet Set multiple key-score pairs(kvs) of a zset in one method call.
func (*Client) QGet ¶
QGet Returns the element a the specified index(position). 0 the first element, 1 the second ... -1 the last element.
func (*Client) QList ¶
QList List list/queue names in range (nameStart, nameEnd]. ("", ""] means no range limit. Refer to scan command for more information about how it work.
func (*Client) QListRangeAll ¶
QListRangeAll Like qlist, The whole range
func (*Client) QPushFront ¶
QPushFront Add one or more than one element to the head of the queue.
func (*Client) QRListRangeAll ¶
func (c *Client) QRListRangeAll(nameStart, nameEnd string, limit int64, cb func(string) error) error
QRListRangeAll Like qrlist, The whole range
func (*Client) QRange ¶
QRange Returns a portion of elements from the queue at the specified range [offset, offset + limit].
func (*Client) QSet ¶
QSet Sets the list element at index to value. An error is returned for out of range indexes.
func (*Client) QSlice ¶
QSlice Returns a portion of elements from the queue at the specified range [begin, end]. begin and end could be negative.
func (*Client) QTrimFront ¶
QTrimFront Remove multi elements from the head of a queue.
func (*Client) RKeysRangeAll ¶
RKeysRangeAll Like rkeys, The whole range
func (*Client) RScanRangeAll ¶
func (c *Client) RScanRangeAll(keyStart, keyEnd string, limit int64, cb func(string, Value) error) error
RScanRangeAll Like rscan, The whole range
func (*Client) Scan ¶
Scan List key-value pairs with keys in range (keyStart, keyEnd]. ("", ""] means no range limit. This command can do wildchar * like search, but only prefix search, and the * char must never occur in keyStart and keyEnd!
func (*Client) ScanRangeAll ¶
func (c *Client) ScanRangeAll(keyStart, keyEnd string, limit int64, cb func(string, Value) error) error
ScanRangeAll Like scan, The whole range
func (*Client) SetNX ¶
SetNX Set the string value in argument as value of the key if and only if the key doesn't exist.
func (*Client) SetX ¶
SetX Set the value of the key, with a time to live. Unlike Redis, the ttl will not be remove when later set the same key!
func (*Client) ZAvg ¶
ZAvg Returns the average of elements of the sorted set stored at the specified key which have scores in the range [start,end].
func (*Client) ZCount ¶
ZCount Returns the number of elements of the sorted set stored at the specified key which have scores in the range [start,end].
func (*Client) ZKeys ¶
func (c *Client) ZKeys(name string, keyStart string, scoreStart, scoreEnd int64, limit int64) ([]string, error)
ZKeys List keys in a zset.
func (*Client) ZKeysRangAll ¶
func (c *Client) ZKeysRangAll(name string, keyStart string, scoreStart, scoreEnd int64, limit int64, cb func(string) error) error
ZKeysRangAll Like zkeys, The whole range
func (*Client) ZList ¶
ZList List zset names in range (nameStart, nameEnd]. Refer to scan command for more information about how it work.
func (*Client) ZListRangAll ¶
ZListRangAll Like zlist, The whole range
func (*Client) ZPopBack ¶
ZPopBack Since 1.9.0, Delete and return limit element(s) from back of the zset.
func (*Client) ZPopFront ¶
ZPopFront Since 1.9.0, Delete and return limit element(s) from front of the zset.
func (*Client) ZRListRangAll ¶
ZRListRangAll Like zrlist, The whole range
func (*Client) ZRRange ¶
ZRRange Returns a range of key-score pairs by index range [offset, offset + limit), in reverse order.
func (*Client) ZRRank ¶
ZRRank Returns the rank(index) of a given key in the specified sorted set, in reverse order.
func (*Client) ZRScan ¶
func (c *Client) ZRScan(name string, keyStart string, scoreStart, scoreEnd int64, limit int64) (map[string]int64, error)
ZRScan List key-score pairs of a zset, in reverse order.
func (*Client) ZRange ¶
ZRange Returns a range of key-score pairs by index range [offset, offset + limit).
func (*Client) ZRemRangeByRank ¶
ZRemRangeByRank Delete the elements of the zset which have rank in the range [start,end].
func (*Client) ZRemRangeByScore ¶
ZRemRangeByScore Delete the elements of the zset which have score in the range [start,end].
func (*Client) ZScan ¶
func (c *Client) ZScan(name string, keyStart string, scoreStart, scoreEnd int64, limit int64) (map[string]int64, error)
ZScan List key-score pairs where key-score in range (keyStart+scoreStart, scoreEnd]. Refer to scan command for more information about how it work.
type Option ¶
type Option func(c *Client)
Option is a function that configures a Client
func DialHandler ¶
DialHandler proxy
type Values ¶
type Values []Value
Values Value Slice
func (Values) MapStringInt ¶
MapStringInt get map[string]int64
func (Values) MapStringValue ¶
MapStringValue get map[string]Value