options

package
v0.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceDefault = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.2.6

type Option func(cfg *Options) error

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

func WithNamespace(namespace string) Option

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 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
}

Contains all available read/write options for the supported engines. Fields are set by closures implementing the SetOptions signature.

func New

func New(options ...Option) (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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL