Documentation ¶
Index ¶
- Variables
- func New(endpoints []string, options *store.Config) (store.Store, error)
- type BoltDB
- func (b *BoltDB) AtomicDelete(key string, previous *store.KVPair) error
- func (b *BoltDB) AtomicPut(key string, value []byte, previous *store.KVPair) (*store.KVPair, error)
- func (b *BoltDB) Close()
- func (b *BoltDB) Exists(key string) (bool, error)
- func (b *BoltDB) Get(key string) (*store.KVPair, error)
- func (b *BoltDB) List(keyPrefix string) ([]*store.KVPair, error)
- func (b *BoltDB) Put(key string, value []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMultipleEndpointsUnsupported is thrown when multiple endpoints specified for // BoltDB. Endpoint has to be a local file path ErrMultipleEndpointsUnsupported = errors.New("boltdb supports one endpoint and should be a file path") // ErrBoltBucketOptionMissing is thrown when boltBcuket config option is missing ErrBoltBucketOptionMissing = errors.New("boltBucket config option missing") )
Functions ¶
Types ¶
type BoltDB ¶
type BoltDB struct { // By default libkv opens and closes the bolt DB connection for every // get/put operation. This allows multiple apps to use a Bolt DB at the // same time. // PersistConnection flag provides an option to override ths behavior. // ie: open the connection in New and use it till Close is called. PersistConnection bool // contains filtered or unexported fields }
BoltDB type implements the Store interface
func (*BoltDB) AtomicDelete ¶
AtomicDelete deletes a value at "key" if the key has not been modified in the meantime, throws an error if this is the case
func (*BoltDB) AtomicPut ¶
AtomicPut puts a value at "key" if the key has not been modified since the last Put, throws an error if this is the case
func (*BoltDB) Get ¶
Get the value at "key". BoltDB doesn't provide an inbuilt last modified index with every kv pair. Its implemented by by a atomic counter maintained by the libkv and appened to the value passed by the client.
Click to show internal directories.
Click to hide internal directories.