kv

package
v0.0.0-...-83a01c7 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 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

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

func (BatchFunc) Batch

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

type DeleteFunc

type DeleteFunc func(key []byte) error

func (DeleteFunc) Delete

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

type FlushFunc

type FlushFunc func() error

func (FlushFunc) Flush

func (f FlushFunc) Flush() error

type GetFunc

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

func (GetFunc) Get

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

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

func (HasFunc) Has

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

type IsNotFoundFunc

type IsNotFoundFunc func(err error) bool

func (IsNotFoundFunc) IsNotFound

func (f IsNotFoundFunc) IsNotFound(err error) bool

type IterateFunc

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

func (IterateFunc) Iterate

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

type KeyFunc

type KeyFunc func() []byte

func (KeyFunc) Key

func (f KeyFunc) Key() []byte

type Pair

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

Pair defines key-value pair.

type PutFlusher

type PutFlusher interface {
	Putter
	Flush() error
}

PutFlusher defines putter with Flush method.

type PutFunc

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

func (PutFunc) Put

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

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

func (SnapshotFunc) Snapshot

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

type Store

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

type ValueFunc func() []byte

func (ValueFunc) Value

func (f ValueFunc) Value() []byte

Jump to

Keyboard shortcuts

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