Documentation ¶
Index ¶
- Constants
- Variables
- type Bucket
- func (b *Bucket) Delete(key interface{}) error
- func (b *Bucket) Get(key interface{}, v interface{}) error
- func (b *Bucket) GetBytes(key interface{}, in []byte) (out []byte, err error)
- func (b *Bucket) Iter() *Iter
- func (b *Bucket) Prefix(prefix interface{}) *Iter
- func (b *Bucket) Put(v interface{}) error
- func (b *Bucket) PutBytes(key interface{}, data []byte) error
- type DB
- type Id
- type Iter
- type Option
Constants ¶
const MaxBuckets = math.MaxUint16 - (8 * 256)
MaxBuckets is the maximum amount of buckets that can be created in a database.
Variables ¶
var (
ErrNotFound = errors.New("record doesn't exist")
)
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket represents a collection of records in the database.
func (*Bucket) Get ¶
Get retrieves a record from the bucket by key, returning ErrNotFound if it doesn't exist.
func (*Bucket) Prefix ¶
Prefix returns an iterator for all the records whose key has the given prefix.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is an opened Bow database.
func Open ¶
Open opens a database at the given directory. If the directory doesn't exist, then it will be created.
Configure the database by passing the result of functions like SetCodec or SetBadgerOptions.
Make sure to call Close after you're done.
func (*DB) Badger ¶
Badger exposes the internal Badger database. Use it to call Backup, Load or RunValueLogGC. Do NOT perform Set operations as you may corrupt Bow.
func (*DB) Bucket ¶
Bucket returns the named bucket, creating it if it doesn't exist. If an error has occurred during creation, it would be returned by any operation on the returned bucket.
type Id ¶
type Id string
Id is a convenient type for randomly generated keys.
func (Id) MarshalJSON ¶
func (*Id) UnmarshalJSON ¶
type Iter ¶
type Iter struct {
// contains filtered or unexported fields
}
func (*Iter) Close ¶
func (it *Iter) Close()
Close closes the Iter. If Next is called and returns false and there are no further results, Iter is closed automatically and it will suffice to check the result of Err.
Directories ¶
Path | Synopsis |
---|---|
key
Package key implements the standard encoding and decoding of Bow keys.
|
Package key implements the standard encoding and decoding of Bow keys. |
msgp
Package msgp implements encoding and decoding of MessagePack, relying on serialization code generated by msgp, the code generation library for MessagePack at github.com/tinylib/msgp.
|
Package msgp implements encoding and decoding of MessagePack, relying on serialization code generated by msgp, the code generation library for MessagePack at github.com/tinylib/msgp. |