boltdb

package module
v0.0.0-...-fada95a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidArgs    = errors.New("invalid args")
	ErrBucketNotFound = errors.New("bucket not found")
	ErrKeyNotFound    = errors.New("key not found")
)

Functions

This section is empty.

Types

type KVStore

type KVStore struct {
	DB *bbolt.DB
}

func Open

func Open(path string, buckets ...string) (*KVStore, error)

func (*KVStore) Close

func (s *KVStore) Close() error

func (*KVStore) CountKV

func (s *KVStore) CountKV(bucket []byte) (int, error)

func (*KVStore) CountKVPrefix

func (s *KVStore) CountKVPrefix(bucket, prefix []byte) (int, error)

func (*KVStore) EachB

func (s *KVStore) EachB(bucket []byte, f func(b *bbolt.Bucket) error) error

func (*KVStore) EachKV

func (s *KVStore) EachKV(bucket []byte, f func(k, v []byte, n int) error) error

func (*KVStore) EachKVPrefix

func (s *KVStore) EachKVPrefix(bucket, prefix []byte, f func(k, v []byte, n int) error) error

func (*KVStore) Get

func (s *KVStore) Get(bucket, k []byte) []byte

func (*KVStore) Query

func (s *KVStore) Query(f func(tx *bbolt.Tx) error) error

func (*KVStore) QueryAndUpdateV

func (s *KVStore) QueryAndUpdateV(bucket, k []byte, f func(k, v []byte, n int) ([]byte, error)) error

func (*KVStore) QueryAndUpdateVPrefix

func (s *KVStore) QueryAndUpdateVPrefix(bucket, prefix []byte, f func(k, v []byte, n int) ([]byte, error)) error

func (*KVStore) QueryB

func (s *KVStore) QueryB(bucket []byte, f func(b *bbolt.Bucket) error) error

func (*KVStore) QueryV

func (s *KVStore) QueryV(bucket, k []byte, f func(k, v []byte, n int) error) error

func (*KVStore) Update

func (s *KVStore) Update(f func(tx *bbolt.Tx) error) error

func (*KVStore) UpdateB

func (s *KVStore) UpdateB(bucket []byte, f func(b *bbolt.Bucket) error) error

func (*KVStore) UpdateV

func (s *KVStore) UpdateV(bucket, k, v []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL