kv

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: LGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchFunc added in v1.3.0

type BatchFunc func(fn func(PutFlusher) error) error

func (BatchFunc) Batch added in v1.3.0

func (f BatchFunc) Batch(fn func(PutFlusher) error) error

type DeleteFunc added in v1.3.0

type DeleteFunc func(key []byte) error

func (DeleteFunc) Delete added in v1.3.0

func (f DeleteFunc) Delete(key []byte) error

type FlushFunc added in v1.3.0

type FlushFunc func() error

func (FlushFunc) Flush added in v1.3.0

func (f FlushFunc) Flush() error

type GetFunc added in v1.3.0

type GetFunc func(key []byte) ([]byte, error)

func (GetFunc) Get added in v1.3.0

func (f GetFunc) Get(key []byte) ([]byte, error)

type Getter

type Getter interface {
	Get(key []byte) ([]byte, error)
	Has(key []byte) (bool, error)
}

Getter defines methods to read kv.

type HasFunc added in v1.3.0

type HasFunc func(key []byte) (bool, error)

func (HasFunc) Has added in v1.3.0

func (f HasFunc) Has(key []byte) (bool, error)

type IsNotFoundFunc added in v1.3.0

type IsNotFoundFunc func(err error) bool

func (IsNotFoundFunc) IsNotFound added in v1.3.0

func (f IsNotFoundFunc) IsNotFound(err error) bool

type IterateFunc added in v1.3.0

type IterateFunc func(rgn Range, fn func(Pair) bool) error

func (IterateFunc) Iterate added in v1.3.0

func (f IterateFunc) Iterate(rng Range, fn func(Pair) bool) error

type KeyFunc added in v1.3.0

type KeyFunc func() []byte

func (KeyFunc) Key added in v1.3.0

func (f KeyFunc) Key() []byte

type Pair added in v1.3.0

type Pair interface {
	Key() []byte
	Value() []byte
}

Pair defines key-value pair.

type PutFlusher added in v1.3.0

type PutFlusher interface {
	Putter
	Flush() error
}

PutFlusher defines putter with Flush method.

type PutFunc added in v1.3.0

type PutFunc func(key, val []byte) error

func (PutFunc) Put added in v1.3.0

func (f PutFunc) Put(key, val []byte) error

type Putter

type Putter interface {
	Put(key, val []byte) error
	Delete(key []byte) error
}

Putter defines methods to write kv.

type Range

type Range struct {
	Start []byte // start of key range (included)
	Limit []byte // limit of key range (excluded)
}

Range is the key range.

type SnapshotFunc added in v1.3.0

type SnapshotFunc func(fn func(Getter) error) error

func (SnapshotFunc) Snapshot added in v1.3.0

func (f SnapshotFunc) Snapshot(fn func(Getter) error) error

type Store added in v1.3.0

type Store interface {
	Getter
	Putter

	Snapshot(fn func(Getter) error) error
	Batch(fn func(PutFlusher) error) error
	Iterate(r Range, fn func(Pair) bool) error
	IsNotFound(err error) bool
}

Store defines the full functional kv store.

type ValueFunc added in v1.3.0

type ValueFunc func() []byte

func (ValueFunc) Value added in v1.3.0

func (f ValueFunc) Value() []byte

Jump to

Keyboard shortcuts

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