Documentation
¶
Overview ¶
Package bolt implements a key value store (kv.Store) using bbolt. For more details, see https://github.com/etcd-io/bbolt
Index ¶
Constants ¶
const Name = "bolt"
Name represents bbolt's shorthand named.
Variables ¶
var DefaultOptions = &Options{ Bucket: "default", Path: Name + ".db", }
DefaultOptions contain's bolts default options.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // Buckets are collections of key/value pairs within the database. // All keys in a bucket must be unique. Bucket string // Path is where the database file will be stored. Path string }
Options represents options for configuring the boltdb cache store.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements a the Store interface for bolt. https://godoc.org/github.com/etcd-io/bbolt
func New ¶
New creates a new bolt cache store. It is up to the operator to make sure that the store's path is writeable.
func (Store) Close ¶
Close releases all database resources. It will block waiting for any open transactions to finish before closing the database and returning.
func (*Store) Get ¶
Get retrieves the value for a key in the bucket. Returns a nil value if the key does not exist or if the key is a nested bucket. The returned value is only valid for the life of the transaction.
func (Store) Set ¶
Set sets the value for a key in the bucket. If the key exist then its previous value will be overwritten. Supplied value must remain valid for the life of the transaction. Returns an error if the bucket was created from a read-only transaction, if the key is blank, if the key is too large, or if the value is too large.