Documentation ¶
Index ¶
- Variables
- type Client
- func (client *Client) Close() (err error)
- func (client *Client) CompareAndSwap(ctx context.Context, key kvstore.Key, oldValue, newValue kvstore.Value) (err error)
- func (client *Client) Delete(ctx context.Context, key kvstore.Key) (err error)
- func (client *Client) Get(ctx context.Context, key kvstore.Key) (_ kvstore.Value, err error)
- func (client *Client) Put(ctx context.Context, key kvstore.Key, value kvstore.Value) (err error)
- func (client *Client) PutAndCommit(ctx context.Context, key kvstore.Key, value kvstore.Value) (err error)
- func (client *Client) Range(ctx context.Context, ...) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Error = errs.Class("boltdb")
Error is the default boltdb errs class.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the entrypoint into a bolt data store.
func (*Client) CompareAndSwap ¶ added in v1.96.4
func (client *Client) CompareAndSwap(ctx context.Context, key kvstore.Key, oldValue, newValue kvstore.Value) (err error)
CompareAndSwap atomically compares and swaps oldValue with newValue.
func (*Client) Get ¶
Get looks up the provided key from boltdb returning either an error or the result.
func (*Client) Put ¶
Put adds a key/value to boltDB in a batch, where boltDB commits the batch to disk every 1000 operations or 10ms, whichever is first. The MaxBatchDelay are using default settings. Ref: https://github.com/boltdb/bolt/blob/master/db.go#L160 Note: when using this method, check if it needs to be executed asynchronously since it blocks for the duration db.MaxBatchDelay.
Click to show internal directories.
Click to hide internal directories.