options

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 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 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.

type Options

type Options struct {
	LevelDBRead  *ldb.ReadOptions
	LevelDBWrite *ldb.WriteOptions
	PebbleWrite  *pebble.WriteOptions
	Namespace    string
}

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