kv

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("key not found")
)

Functions

This section is empty.

Types

type Bolt

type Bolt struct {
	// contains filtered or unexported fields
}

func (*Bolt) Close

func (b *Bolt) Close() error

func (*Bolt) Delete

func (b *Bolt) Delete(key string) error

Delete removes a key from the bucket. If the key does not exist then nothing is done and a nil error is returned

func (*Bolt) Get

func (b *Bolt) Get(key string) ([]byte, error)

func (*Bolt) Set

func (b *Bolt) Set(key string, val []byte) error

type KV

type KV interface {
	Get(key string) ([]byte, error)
	Set(key string, value []byte) error
	Delete(key string) error
	Close() error
}

func New

func New(opts Options) (KV, error)

type Options

type Options struct {
	NS   string `validate:"required"`
	Path string `validate:"required"`
}

Jump to

Keyboard shortcuts

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