bucket

package
v0.12.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNilFilterHandler when FilterHandler is empty
	ErrNilFilterHandler = errors.New("handler can't be nil")

	// ErrNotFound is returned by key-value storage methods
	// that could not find element by key.
	ErrNotFound = errors.New("key not found")
)
View Source
var ErrIteratingAborted = errors.New("iteration aborted")

ErrIteratingAborted is returned by storage iterator after iteration has been interrupted.

Functions

This section is empty.

Types

type Bucket

type Bucket interface {
	Get(key []byte) ([]byte, error)
	Set(key, value []byte) error
	Del(key []byte) error
	Has(key []byte) bool
	Size() int64
	List() ([][]byte, error)
	Iterate(FilterHandler) error
	// Steam can be implemented by badger.Stream, but not for now
	// Stream(ctx context.Context, key []byte, cb func(io.ReadWriter) error) error
	Close() error
}

Bucket is sub-store interface.

type BucketItem

type BucketItem struct {
	Key []byte
	Val []byte
}

BucketItem used in filter.

type FilterHandler

type FilterHandler func(key, val []byte) bool

FilterHandler where you receive key/val in your closure.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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