kv

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 2 Imported by: 1

README

K/V (Store) Abstraction Layer

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyFound    = errors.New("key: key found")
	ErrKeyNotFound = errors.New("key: key not found")
)

Functions

This section is empty.

Types

type Bucket

type Bucket []byte

type Creater

type Creater interface {
	CreateKV(ctx context.Context, b []byte, v ...Pair) error
	CreateKVFn(ctx context.Context, b []byte, fn func(ctx PutContext) error) error
}

type DeleteContext

type DeleteContext interface {
	context.Context
	Delete(k []byte) error
}

type Deleter

type Deleter interface {
	DeleteKV(ctx context.Context, b []byte, v ...[]byte) error
	DeleteKVFn(ctx context.Context, b []byte, fn func(ctx DeleteContext) error) error
}

type GetContext

type GetContext interface {
	context.Context
	Get(k []byte, copy bool) ([]byte, error)
}

type Key

type Key []byte

type Lister

type Lister interface {
	ListKV(ctx context.Context, b []byte) ([]Pair, error)
	ListKVFn(ctx context.Context, b []byte, fn func(k []byte, v []byte) error) error
}

type Pair

type Pair struct {
	Key   []byte
	Value []byte
}

type PutContext

type PutContext interface {
	context.Context
	Put(k []byte, v []byte) error
}

type Reader

type Reader interface {
	ReadKV(ctx context.Context, b []byte, v ...[]byte) ([]Pair, error)
	ReadKVFn(ctx context.Context, b []byte, fn func(ctx GetContext) error) error
}

type Store

type Store interface {
	Storer
	Creater
	Reader
	Updater
	Deleter
	Lister
}

type Storer

type Storer interface {
	StoreKV(ctx context.Context, b []byte, v ...Pair) error
	StoreKVFn(ctx context.Context, b []byte, fn func(ctx PutContext) error) error
}

type Updater

type Updater interface {
	UpdateKV(ctx context.Context, b []byte, v ...Pair) error
	UpdateKVFn(ctx context.Context, b []byte, fn func(ctx PutContext) error) error
}

type Value

type Value []byte

Directories

Path Synopsis
store

Jump to

Keyboard shortcuts

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