Documentation ¶
Index ¶
- Variables
- func Compression(ct CompressorType) func(db *DB) error
- func CreateBucket(db *bolt.DB, bucketName []byte) error
- func CreateBucketPath(db *bolt.DB, bucketPath [][]byte) error
- func Get(db *bolt.DB, bucketName, key []byte) ([]byte, error)
- func GetPath(db *bolt.DB, bucketNames [][]byte, key []byte) ([]byte, error)
- func Iterate(db *bolt.DB, bucketName []byte, fn func(k, v []byte) error, ...) error
- func IteratePrefix(db *bolt.DB, bucketName, prefix []byte, fn func(k, v []byte) error) error
- func Put(db *bolt.DB, bucketName interface{}, key, value []byte) error
- func PutPath(db *bolt.DB, bucketNames [][]byte, key, value []byte) error
- type Compressor
- type CompressorType
- type DB
- func (db *DB) CreateBucket(bucketName []byte) error
- func (db *DB) CreateBucketPath(bucketPath [][]byte) error
- func (db *DB) Get(bucketName, key []byte) ([]byte, error)
- func (db *DB) GetJSON(bucketName, key []byte, v interface{}) (err error)
- func (db *DB) GetPath(bucketName [][]byte, key []byte) ([]byte, error)
- func (db *DB) Iterate(bucketName []byte, fn func(k, v []byte) error) error
- func (db *DB) IterateGzipped(bucketName []byte, fn func(k, v []byte) error) error
- func (db *DB) IteratePrefix(bucketName, prefix []byte, fn func(k, v []byte) error) error
- func (db *DB) Put(bucketName interface{}, key, value []byte) (err error)
- func (db *DB) PutJSON(bucketName, key []byte, v interface{}) error
- func (db *DB) PutPath(bucketName [][]byte, key, value []byte) error
- type Opt
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound not found error ErrNotFound = fmt.Errorf("not found") // ErrBreak break's iterator ErrBreak = fmt.Errorf("break") )
Functions ¶
func Compression ¶
func Compression(ct CompressorType) func(db *DB) error
func CreateBucket ¶
CreateBucket create bucket if not exists
func Iterate ¶
func Iterate(db *bolt.DB, bucketName []byte, fn func(k, v []byte) error, compressors ...Compressor) error
Iterate over database
func IteratePrefix ¶
IteratePrefix over database
Types ¶
type Compressor ¶
type CompressorType ¶
type CompressorType int
const ( NoopCompressor CompressorType = iota GzipCompressor Lz4Compressor )
type DB ¶
type DB struct { *bolt.DB Compressor Compressor }
DB wrapper for bolt.DB
func (*DB) CreateBucket ¶
CreateBucket create buckt if it not exists
func (*DB) CreateBucketPath ¶
func (*DB) IterateGzipped ¶
func (*DB) IteratePrefix ¶
IteratePrefix over db
Click to show internal directories.
Click to hide internal directories.