Documentation
¶
Index ¶
- Variables
- 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) Error(errs ...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 ¶
Functions ¶
func BucketNameConcat ¶
BucketNameConcat concat bucket name
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB database struct, contain boltdb DB struct
func NewDB ¶ added in v0.0.3
NewDB assemble DB struct, input boltdb DB struct
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx transaction struct, contain boltdb Tx and error
func (*Tx) Delete ¶
Delete delete value in bucket by keys, input multiple key, like [key1, key2, ...]
func (*Tx) ForEach ¶
ForEach traveral all key value in bucket
func (*Tx) Get ¶
Get get values from bucket by keys, input multiple and return multiple, like [key1, kye2, ...]
func (*Tx) Next ¶
Next get limit count value after key in bucket
func (*Tx) NextSequence ¶
NextSequence get next sequence in bucket, if bucket not exist, create it, begin with 0, next 1
func (*Tx) Prev ¶
Prev get limit count value front key in bucket
func (*Tx) Put ¶
Put put keys values to bucket, input multiple key value, like [key1,value1,key2,value2, ...]
func (*Tx) Rollback ¶
Rollback rollback data when some error happened
func (*Tx) Sequence ¶
Sequence get current sequence in bucket, if bucket not exist, create it, begin with 0
func (*Tx) SortDelete ¶
SortDelete delete key value in bucket with sort
func (*Tx) SortDeleteBucket ¶
SortDeleteBucket sort delete bucket
func (*Tx) SortNext ¶
SortNext get limit count key value after key in bucket with sort
func (*Tx) SortPrev ¶
SortPrev get limit count key value front key in bucket with sort