Documentation ¶
Index ¶
- func BucketNameConcat(slices ...[]byte) []byte
- func BytesConcat(slices ...[]byte) []byte
- func BytesToString(b []byte) string
- func BytesToUint64(v []byte) uint64
- func StringToBytes(s string) []byte
- func Uint64ToBytes(v uint64) []byte
- type DB
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) Delete(name []byte, keys ...[]byte) error
- func (tx *Tx) DeleteBucket(name []byte) error
- func (tx *Tx) Err() error
- func (tx *Tx) Error(err error) error
- func (tx *Tx) ForEach(name []byte, fn func(k, v []byte) error) error
- func (tx *Tx) Get(name []byte, keys ...[]byte) [][]byte
- func (tx *Tx) Next(name []byte, key []byte, limit int) [][]byte
- func (tx *Tx) NextSequence(name []byte) (uint64, error)
- func (tx *Tx) Prev(name []byte, key []byte, limit int) [][]byte
- func (tx *Tx) Put(name []byte, kvs ...[]byte) error
- func (tx *Tx) Rollback() error
- func (tx *Tx) Sequence(name []byte) uint64
- func (tx *Tx) SortDelete(name []byte, keys ...[]byte) error
- func (tx *Tx) SortDeleteBucket(name []byte) error
- func (tx *Tx) SortNext(name []byte, key []byte, limit int) [][]byte
- func (tx *Tx) SortPrev(name []byte, key []byte, limit int) [][]byte
- func (tx *Tx) SortPut(name []byte, sortKey []byte, kvs ...[]byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BucketNameConcat ¶
BucketNameConcat concat bytes
func BytesToString ¶
BytesToString converts byte slice to a string without memory allocation. []byte("abc") -> "abc" s
func BytesToUint64 ¶
BytesToUint64 return an int64 of v v (8-byte big endian) -> uint64(123456).
func StringToBytes ¶
StringToBytes converts string to a byte slice without memory allocation. "abc" -> []byte("abc")
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) Next ¶
Next name: bucket name key: start key,if key == nil or len(key) == 0,start at first,if key not exist,return nil limit: limit count,0 representative of all
func (*Tx) Prev ¶
Prev name: bucket name key: start key,if key == nil or len(key) == 0,start at last,if key not exist,return nil limit: limit count,0 representative of all
func (*Tx) SortNext ¶
SortNext name: bucket name key: start key,if key == nil or len(key) == 0,start at first,if key not exist,return nil limit: limit count,0 representative of all
func (*Tx) SortPrev ¶
SortPrev name: bucket name key: start key,if key == nil or len(key) == 0,start at last,if key not exist,return nil limit: limit count,0 representative of all