Documentation ¶
Index ¶
- Variables
- func DecodeUint64(valueBytes []byte) uint64
- func EncodeUint64(value uint64) []byte
- type Bucket
- func (bucket *Bucket) Bucket(path []byte) (*Bucket, error)
- func (bucket *Bucket) DB() *DB
- func (bucket *Bucket) Delete(key []byte) error
- func (bucket *Bucket) DeleteBucket(path []byte) error
- func (bucket *Bucket) DeleteWithPrefix(keyPrefix []byte) error
- func (bucket *Bucket) ForEach(cb ForEachCallback) error
- func (bucket *Bucket) ForEachWithKeyPrefix(keyPrefix []byte, cb ForEachCallback) error
- func (bucket *Bucket) Get(key []byte) []byte
- func (bucket *Bucket) Name() []byte
- func (bucket *Bucket) NextSequence() (uint64, error)
- func (bucket *Bucket) Put(key []byte, value []byte) error
- func (bucket *Bucket) Stats() BucketStats
- func (bucket *Bucket) TX() *TX
- type BucketStats
- type DB
- type ForEachCallback
- type Options
- type TX
- type WithTxCallback
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidPath = errors.New("invalid path") ErrBucketNotFound = bbolt.ErrBucketNotFound ErrTxNotWritable = bbolt.ErrTxNotWritable ErrDatabaseReadOnly = bbolt.ErrDatabaseReadOnly )
Functions ¶
func DecodeUint64 ¶ added in v1.1.0
DecodeUint64 decodes a little endian uint64 value
func EncodeUint64 ¶ added in v1.1.0
EncodeUint64 stores an uint64 into a byte array using little endian format
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket is an implementation of Bucket within a transaction in BoltDB
func (*Bucket) DeleteBucket ¶
DeleteBucket removes an existing child bucket on the database NOTE: Inner sub-keys and buckets will be also deleted
func (*Bucket) DeleteWithPrefix ¶
DeleteWithPrefix deletes a set of keys
func (*Bucket) ForEach ¶
func (bucket *Bucket) ForEach(cb ForEachCallback) error
ForEach calls a callback for all the keys within the bucket
func (*Bucket) ForEachWithKeyPrefix ¶
func (bucket *Bucket) ForEachWithKeyPrefix(keyPrefix []byte, cb ForEachCallback) error
ForEachWithKeyPrefix calls a callback for all the keys starting with the provided prefix within the bucket
func (*Bucket) NextSequence ¶
NextSequence returns an autoincrement integer for the bucket
func (*Bucket) Stats ¶
func (bucket *Bucket) Stats() BucketStats
type BucketStats ¶
type BucketStats = bbolt.BucketStats
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB represents a database connection to BoltDB
func NewWithOptions ¶ added in v1.1.0
NewWithOptions returns a new database wrapper using the provided options.
func (*DB) Delete ¶ added in v1.1.0
Delete deletes a specific key in the specified bucket. No error is returned if key is not found
func (*DB) Get ¶ added in v1.1.0
Get returns the value of a key in the specified bucket or nil if not found
type ForEachCallback ¶
ForEachCallback is a callback that is called for every key found in the given request NOTE: If value == nil, then they key points to a child bucket
type Options ¶ added in v1.1.0
Options specified a set of options when creating/opening the database
type TX ¶
type TX struct {
// contains filtered or unexported fields
}
TX represents a read-write or read-only transaction in BoltDB
func (*TX) DeleteBucket ¶
DeleteBucket removes an existing child bucket on the database NOTE: Inner sub-keys and buckets will be also deleted
type WithTxCallback ¶
WithTxCallback is a callback to be called after the transaction is initiated