bolt

package module
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

bolt

bbolt简单封装。

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func CountKV

func CountKV(db *bbolt.DB, bucket []byte) (int, error)

func CountKVPrefix

func CountKVPrefix(db *bbolt.DB, bucket, prefix []byte) (int, error)

func EachWithBucket added in v1.2.0

func EachWithBucket(db *bbolt.DB, bucket []byte, fun func(*bbolt.Bucket) error) error

func EachWithKV added in v1.2.0

func EachWithKV(db *bbolt.DB, bucket []byte, fun func([]byte, []byte) error) error

func Get

func Get(db *bbolt.DB, bucket, key []byte) []byte

func GetWithBucket added in v1.1.0

func GetWithBucket(db *bbolt.DB, bucket []byte, fun func(*bbolt.Bucket) error) error

func GetWithDB added in v1.1.0

func GetWithDB(db *bbolt.DB, fun func(*bbolt.Tx) error) error

func GetWithKVPrefix added in v1.2.0

func GetWithKVPrefix(db *bbolt.DB, bucket, prefix []byte, fun func([]byte, []byte) error) error

func GetWithValue added in v1.1.0

func GetWithValue(db *bbolt.DB, bucket, key []byte, fun func([]byte) error) error

func Open

func Open(path string, buckets ...[]byte) (*bbolt.DB, error)

func Put added in v1.1.0

func Put(db *bbolt.DB, bucket, key, value []byte) error

func PutWithBucket added in v1.1.0

func PutWithBucket(db *bbolt.DB, bucket []byte, fun func(*bbolt.Bucket) error) error

func PutWithDB added in v1.1.0

func PutWithDB(db *bbolt.DB, fun func(*bbolt.Tx) error) error

func PutWithKVPrefix added in v1.2.0

func PutWithKVPrefix(db *bbolt.DB, bucket, prefix []byte, fun func([]byte, []byte) ([]byte, error)) error

func PutWithValue added in v1.1.0

func PutWithValue(db *bbolt.DB, bucket, key []byte, fun func([]byte) ([]byte, error)) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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