Documentation
¶
Index ¶
- Variables
- func Bconcat(parts ...[]byte) []byte
- func BytesToDigitString(b []byte) string
- func BytesToUint64(v []byte) uint64
- func DigitStringToBytes(s string) []byte
- func DigitStringToUint64(s string) uint64
- func SetJsonField(obj interface{}, path string, value interface{}) ([]byte, error)
- func ToJsonBytes(v interface{}) ([]byte, error)
- func Uint64ToBytes(v uint64) []byte
- type DB
- func (db *DB) BackupTo(backupPath string) error
- func (db *DB) Close() error
- func (db *DB) CompactAll() error
- func (db *DB) GetSnapshot(key []byte) ([]byte, 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) uint64
- func (db *DB) HhasKey(name string, key []byte) bool
- func (db *DB) Hincr(name string, key []byte, step int64) (newNum uint64, err 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) Hprefix(name string, prefix []byte, limit int) *Reply
- 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) Hset(name string, key, val []byte) error
- func (db *DB) RestoreFrom(backupPath string) error
- func (db *DB) StatsStruct() (*DBStats, 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) uint64
- func (db *DB) ZhasKey(name string, key []byte) bool
- 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) Zrscan(name string, keyStart, scoreStart []byte, limit int) *Reply
- func (db *DB) Zscan(name string, keyStart, scoreStart []byte, limit int) *Reply
- func (db *DB) Zset(name string, key []byte, val uint64) error
- type DBStats
- type Entry
- type RawData
- 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() gjson.Result
- func (r *Reply) KvEach(fn func(key, value RawData)) 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
- type SSTableEntry
- type TableStat
Constants ¶
This section is empty.
Variables ¶
var ( HashKeyPrefix = []byte{31} ZsetKeyPrefix = []byte{30} ZsetScorePrefix = []byte{29} SplitChar = []byte{28} )
Functions ¶
func BytesToDigitString ¶
BytesToDigitString converts an 8-byte big endian byte slice to a digit string. Example: []byte{...} -> uint64(123456) -> "123456"
func BytesToUint64 ¶
BytesToUint64 return an uint64 of v v (8-byte big endian) -> uint64(123456).
func DigitStringToBytes ¶
DigitStringToBytes returns an 8-byte big endian representation of a digit string. Example: "123456" -> uint64(123456) -> []byte{...}
func DigitStringToUint64 ¶
DigitStringToUint64 parses a digit string into a uint64 number. Example: "123456" -> 123456
func SetJsonField ¶
SetJsonField converts any input to JSON and sets a field using sjson.
func ToJsonBytes ¶
json utils ToJsonBytes converts a struct, map, string, or []byte into a valid JSON []byte.
func Uint64ToBytes ¶
Uint64ToBytes returns an 8-byte big endian representation of v v uint64(123456) -> 8-byte big endian.
Types ¶
type DB ¶
func OpenDefault ¶
func (*DB) CompactAll ¶
func (*DB) HdelBucket ¶
func (*DB) RestoreFrom ¶
func (*DB) StatsStruct ¶
func (*DB) ZdelBucket ¶
type DBStats ¶
type DBStats struct {
Compactions string `json:"compactions"` // raw compaction stats text
TableStats map[int]TableStat `json:"table_stats"` // parsed per-level table stats
SSTableInfo string `json:"sstable_info"` // raw sstables info text
SSTables map[int][]SSTableEntry `json:"sstables"` // parsed per-level SSTable entries
BlockPoolInfo string `json:"block_pool_info"` // raw block pool info
OpenedTablesInfo string `json:"opened_tables_info"` // raw opened tables info
}
type RawData ¶
type RawData []byte