Documentation ¶
Index ¶
- Constants
- type Option
- func WithForce() Option
- func WithLevelDBRead(opts *ldb.ReadOptions) Option
- func WithLevelDBWrite(opts *ldb.WriteOptions) Option
- func WithNamespace(namespace string) Option
- func WithPebbleWrite(opts *pebble.WriteOptions) Option
- func WithRequireExists() Option
- func WithRequireNotExists() Option
- func WithTombstones() Option
- type Options
Constants ¶
const (
NamespaceDefault = "default"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v0.2.6
Defines the signature of functions accepted as parameters by Honu methods.
func WithForce ¶ added in v0.2.7
func WithForce() Option
WithForce prevents validation checks from returning an error during accesses.
func WithLevelDBRead ¶ added in v0.2.6
func WithLevelDBRead(opts *ldb.ReadOptions) Option
Closure returning a function that adds the leveldbRead parameter to an Options struct's LeveldbRead field.
func WithLevelDBWrite ¶ added in v0.2.6
func WithLevelDBWrite(opts *ldb.WriteOptions) Option
Closure returning a function that adds the leveldbWrite parameter to an Options struct's LeveldbWrite field.
func WithNamespace ¶
WithNamespace returns a closure that sets a namespace other than the default.
func WithPebbleWrite ¶
func WithPebbleWrite(opts *pebble.WriteOptions) Option
Closure returning a function that adds the pebbleWrite parameter to an Options struct's PebbleWrite field.
func WithRequireExists ¶ added in v0.4.0
func WithRequireExists() Option
WithRequireExists adds an invariants to writes that the key has to exist prior to the write operation otherwise the operation will fail with a NotFound error. This is a similar semantic to "Update" for Put and is a check to ensure that something was removed for Delete.
func WithRequireNotExists ¶ added in v0.4.0
func WithRequireNotExists() Option
WithRequireNotExists adds an invariant to writes that the key must not exist prior to the write operation otherwise the operation will fail with an AlreadyExists error. This is a similar semantic to "Create" for Put and while it has no real meaning for Delete, the invariant is still enforced.
func WithTombstones ¶ added in v0.2.8
func WithTombstones() Option
WithTombstones causes the iterator to include tombstones as its iterating.
type Options ¶
type Options struct { LevelDBRead *ldb.ReadOptions LevelDBWrite *ldb.WriteOptions PebbleWrite *pebble.WriteOptions Namespace string Force bool Tombstones bool RequireExists bool RequireNotExists bool }
Contains all available read/write options for the supported engines. Fields are set by closures implementing the SetOptions signature.