Documentation
¶
Index ¶
Constants ¶
const (
NamespaceDefault = "default"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
LevelDBRead *ldb.ReadOptions
LevelDBWrite *ldb.WriteOptions
PebbleWrite *pebble.WriteOptions
Namespace string
Destroy bool
}
Contains all available read/write options for the supported engines. Fields are set by closures implementing the SetOptions signature.
func New ¶
func New(options ...SetOptions) (cfg *Options, err error)
New creates a per-call Options object based on the variadic SetOptions closures supplied by the user. New also sets sensible defaults for various options.
type SetOptions ¶
Defines the signature of functions accepted as parameters by Honu methods.
func WithDestroy ¶
func WithDestroy() SetOptions
WithDestroy returns a closure that sets an option so that instead of creating a tombstone, the data is permanently deleted from the database, meaning that a subsequent Put will restart the versioning. Use Destroy with care in a distributed system, if you destroy a key in an anti-entropy environment it will simply be repaired by the system to the latest version before the Delete.
func WithLeveldbRead ¶
func WithLeveldbRead(opts *ldb.ReadOptions) SetOptions
Closure returning a function that adds the leveldbRead parameter to an Options struct's LeveldbRead field.
func WithLeveldbWrite ¶
func WithLeveldbWrite(opts *ldb.WriteOptions) SetOptions
Closure returning a function that adds the leveldbWrite parameter to an Options struct's LeveldbWrite field.
func WithNamespace ¶
func WithNamespace(namespace string) SetOptions
WithNamespace returns a closure that sets a namespace other than the default.
func WithPebbleWrite ¶
func WithPebbleWrite(opts *pebble.WriteOptions) SetOptions
Closure returning a function that adds the pebbleWrite parameter to an Options struct's PebbleWrite field.