kv

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket added in v1.7.0

type Bucket string

Bucket provides logical bucket for kv store.

func (Bucket) NewGetter added in v1.7.0

func (b Bucket) NewGetter(src Getter) Getter

NewGetter creates a bucket getter from the source getter.

func (Bucket) NewPutter added in v1.7.0

func (b Bucket) NewPutter(src Putter) Putter

NewPutter creates a bucket putter from the source putter.

func (Bucket) NewStore added in v1.7.0

func (b Bucket) NewStore(src Store) Store

NewStore creates a bucket store from the source store.

type Bulk added in v1.7.0

type Bulk interface {
	Putter
	EnableAutoFlush() // if set, the bulk will be non-atomic
	Write() error
}

Bulk is the bulk putter.

type BulkFunc added in v1.7.0

type BulkFunc func() Bulk

func (BulkFunc) Bulk added in v1.7.0

func (f BulkFunc) Bulk() Bulk

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 EnableAutoFlushFunc added in v1.7.0

type EnableAutoFlushFunc func()

func (EnableAutoFlushFunc) EnableAutoFlush added in v1.7.0

func (f EnableAutoFlushFunc) EnableAutoFlush()

type ErrorFunc added in v1.7.0

type ErrorFunc func() error

func (ErrorFunc) Error added in v1.7.0

func (f ErrorFunc) Error() error

type FirstFunc added in v1.7.0

type FirstFunc func() bool

func (FirstFunc) First added in v1.7.0

func (f FirstFunc) First() bool

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)
	IsNotFound(err error) bool
}

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(r Range) Iterator

func (IterateFunc) Iterate added in v1.3.0

func (f IterateFunc) Iterate(r Range) Iterator

type Iterator

type Iterator interface {
	First() bool
	Last() bool
	Next() bool
	Prev() bool
	Key() []byte
	Value() []byte
	Release()
	Error() error
}

Iterator iterates over kv pairs.

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 LastFunc added in v1.7.0

type LastFunc func() bool

func (LastFunc) Last added in v1.7.0

func (f LastFunc) Last() bool

type NextFunc added in v1.7.0

type NextFunc func() bool

func (NextFunc) Next added in v1.7.0

func (f NextFunc) Next() bool

type PrevFunc added in v1.7.0

type PrevFunc func() bool

func (PrevFunc) Prev added in v1.7.0

func (f PrevFunc) Prev() bool

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 ReleaseFunc added in v1.7.0

type ReleaseFunc func()

func (ReleaseFunc) Release added in v1.7.0

func (f ReleaseFunc) Release()

type Snapshot added in v1.7.0

type Snapshot interface {
	Getter
	Release()
}

Snapshot is the store's snapshot.

type SnapshotFunc added in v1.3.0

type SnapshotFunc func() Snapshot

func (SnapshotFunc) Snapshot added in v1.3.0

func (f SnapshotFunc) Snapshot() Snapshot

type Store added in v1.3.0

type Store interface {
	Getter
	Putter

	Snapshot() Snapshot
	Bulk() Bulk
	Iterate(r Range) Iterator
}

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

type WriteFunc added in v1.7.0

type WriteFunc func() error

func (WriteFunc) Write added in v1.7.0

func (f WriteFunc) Write() error

Jump to

Keyboard shortcuts

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