Documentation ¶
Index ¶
- Variables
- type Client
- func (client *Client) Close() (err error)
- func (client *Client) CompareAndSwap(ctx context.Context, key storage.Key, oldValue, newValue storage.Value) (err error)
- func (client *Client) Delete(ctx context.Context, key storage.Key) (err error)
- func (client *Client) DeleteMultiple(ctx context.Context, keys []storage.Key) (_ storage.Items, err error)
- func (client *Client) Get(ctx context.Context, key storage.Key) (_ storage.Value, err error)
- func (client *Client) GetAll(ctx context.Context, keys storage.Keys) (_ storage.Values, err error)
- func (client *Client) Iterate(ctx context.Context, opts storage.IterateOptions, ...) (err error)
- func (client *Client) IterateWithoutLookupLimit(ctx context.Context, opts storage.IterateOptions, ...) (err error)
- func (client *Client) List(ctx context.Context, first storage.Key, limit int) (_ storage.Keys, err error)
- func (client *Client) LookupLimit() int
- func (client *Client) Put(ctx context.Context, key storage.Key, value storage.Value) (err error)
- func (client *Client) PutAndCommit(ctx context.Context, key storage.Key, value storage.Value) (err error)
- func (client *Client) SetLookupLimit(v int)
Constants ¶
This section is empty.
Variables ¶
var Error = errs.Class("boltdb error")
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 v0.16.0
func (client *Client) CompareAndSwap(ctx context.Context, key storage.Key, oldValue, newValue storage.Value) (err error)
CompareAndSwap atomically compares and swaps oldValue with newValue.
func (*Client) DeleteMultiple ¶ added in v0.33.2
func (client *Client) DeleteMultiple(ctx context.Context, keys []storage.Key) (_ storage.Items, err error)
DeleteMultiple deletes keys ignoring missing keys.
func (*Client) Get ¶
Get looks up the provided key from boltdb returning either an error or the result.
func (*Client) GetAll ¶
GetAll finds all values for the provided keys (up to LookupLimit). If more keys are provided than the maximum, an error will be returned.
func (*Client) Iterate ¶
func (client *Client) Iterate(ctx context.Context, opts storage.IterateOptions, fn func(context.Context, storage.Iterator) error) (err error)
Iterate iterates over items based on opts.
func (*Client) IterateWithoutLookupLimit ¶ added in v1.4.1
func (client *Client) IterateWithoutLookupLimit(ctx context.Context, opts storage.IterateOptions, fn func(context.Context, storage.Iterator) error) (err error)
IterateWithoutLookupLimit calls the callback with an iterator over the keys, but doesn't enforce default limit on opts.
func (*Client) List ¶
func (client *Client) List(ctx context.Context, first storage.Key, limit int) (_ storage.Keys, err error)
List returns either a list of keys for which boltdb has values or an error.
func (*Client) LookupLimit ¶ added in v0.31.0
LookupLimit returns the maximum limit that is allowed.
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 need to be executed asynchronously since it blocks for the duration db.MaxBatchDelay.
func (*Client) PutAndCommit ¶ added in v0.11.0
func (client *Client) PutAndCommit(ctx context.Context, key storage.Key, value storage.Value) (err error)
PutAndCommit adds a key/value to BoltDB and writes it to disk.
func (*Client) SetLookupLimit ¶ added in v0.31.0
SetLookupLimit sets the lookup limit.