Documentation ¶
Overview ¶
Package youdb is a Bolt wrapper that allows easy store hash, zset data.
Index ¶
- func B2ds(v []byte) string
- func B2i(v []byte) uint64
- func B2s(b []byte) string
- func Bconcat(slices [][]byte) []byte
- func DS2b(v string) []byte
- func DS2i(v string) uint64
- func I2b(v uint64) []byte
- func S2b(s string) []byte
- type BS
- type DB
- func (db *DB) Close() error
- func (db *DB) Hdel(name string, key []byte) error
- func (db *DB) HdelBucket(name string) error
- func (db *DB) Hget(name string, key []byte) *Reply
- func (db *DB) HgetInt(name string, key []byte) (val uint64)
- func (db *DB) Hincr(name string, key []byte, step int64) (uint64, error)
- func (db *DB) Hmdel(name string, keys [][]byte) error
- func (db *DB) Hmget(name string, keys [][]byte) *Reply
- func (db *DB) Hmset(name string, kvs ...[]byte) error
- func (db *DB) HnextSequence(name string) (uint64, error)
- func (db *DB) Hrscan(name string, keyStart []byte, limit int) *Reply
- func (db *DB) Hscan(name string, keyStart []byte, limit int) *Reply
- func (db *DB) Hsequence(name string) uint64
- func (db *DB) Hset(name string, key, val []byte) error
- func (db *DB) HsetSequence(name string, v uint64) error
- func (db *DB) Zdel(name string, key []byte) error
- func (db *DB) ZdelBucket(name string) error
- func (db *DB) Zget(name string, key []byte) *Reply
- func (db *DB) Zincr(name string, key []byte, step int64) (uint64, error)
- func (db *DB) Zmdel(name string, keys [][]byte) error
- func (db *DB) Zmget(name string, keys [][]byte) *Reply
- func (db *DB) Zmset(name string, kvs ...[]byte) error
- func (db *DB) ZnextSequence(name string) (uint64, error)
- func (db *DB) Zrscan(name string, keyStart, scoreStart []byte, limit int) *Reply
- func (db *DB) Zscan(name string, keyStart, scoreStart []byte, limit int) *Reply
- func (db *DB) Zsequence(name string) uint64
- func (db *DB) Zset(name string, key []byte, val uint64) error
- func (db *DB) ZsetSequence(name string, v uint64) error
- type Entry
- type Reply
- func (r *Reply) Bytes() []byte
- func (r *Reply) Dict() map[string][]byte
- func (r *Reply) Int() int
- func (r *Reply) Int64() int64
- func (r *Reply) JSON(v interface{}) error
- func (r *Reply) KvEach(fn func(key, value BS)) int
- func (r *Reply) KvLen() int
- func (r *Reply) List() []Entry
- func (r *Reply) NotFound() bool
- func (r *Reply) OK() bool
- func (r *Reply) String() string
- func (r *Reply) Uint() uint
- func (r *Reply) Uint64() uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DS2b ¶
DS2b returns an 8-byte big endian representation of Digit string v ("123456") -> uint64(123456) -> 8-byte big endian.
Types ¶
type BS ¶
type BS []byte
func (BS) JSON ¶
JSON parses the JSON-encoded Reply Entry value and stores the result in the value pointed to by v.
type DB ¶
DB embeds a bolt.DB.
func (*DB) HdelBucket ¶
HdelBucket delete all keys in a hashmap.
func (*DB) HnextSequence ¶
HnextSequence updates the sequence number for the bucket.
func (*DB) Hrscan ¶
Hrscan list key-value pairs of a hashmap with keys in range (key_start, key_end], in reverse order.
func (*DB) Hsequence ¶
Hsequence returns the current integer for the bucket without incrementing it.
func (*DB) HsetSequence ¶
HsetSequence updates the sequence number for the bucket.
func (*DB) ZdelBucket ¶
ZdelBucket delete all keys in a zset.
func (*DB) ZnextSequence ¶
ZnextSequence updates the sequence number for the bucket.
func (*DB) Zscan ¶
Zscan list key-score pairs in a zset, where key-score in range (key_start+score_start, score_end].
func (*DB) Zsequence ¶
Zsequence returns the current integer for the bucket without incrementing it.
type Reply ¶
Reply a holder for a Entry list of a hashmap.
func (*Reply) JSON ¶
JSON parses the JSON-encoded Reply Entry value and stores the result in the value pointed to by v.