kv

package
v1.3.2-0...-4312943 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("value not found")
	ErrInternalError = errors.New("internal store error")
	ErrNotSupport    = errors.New("not support")
)

Exported errors

Functions

This section is empty.

Types

type Namespace

type Namespace interface {
	fmt.Stringer

	// In returns the namespace instance with path.
	In(path ...string) Namespace
	// Get returns the value in the namespace with key.
	Get(ctx context.Context, key string) ([]byte, error)
	// Set sets the value in the namespace with key.
	Set(ctx context.Context, key string, value []byte) error
	// Delete deletes the value in the namespace with key.
	Delete(ctx context.Context, key string) error
	// Iterate iterates the values in the namespace.
	Iterate(
		ctx context.Context, f func(key string, value []byte) (next bool)) error
	// Drop drops all the values in the namespace.
	Drop(ctx context.Context) error
}

Namespace defines a namespace in a kv.Store.

type Store

type Store interface {
	fmt.Stringer

	// Close finalizes a kv.Store.
	Close() error
	// In returns the namespace instance with path.
	In(path ...string) Namespace
}

Store defines a key-value store interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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