kv

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Namespaces added in v0.8.0

func Namespaces(path string) (_ []string, rerr error)

Namespaces returns all namespaces in the database

Types

type Bolt added in v0.5.0

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

func (*Bolt) Delete added in v0.7.0

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 added in v0.5.0

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

func (*Bolt) Set added in v0.5.0

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

type File added in v0.9.1

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

func NewFile added in v0.9.1

func NewFile(path string) (*File, error)

func (*File) Delete added in v0.9.1

func (f *File) Delete(key string) error

func (*File) Get added in v0.9.1

func (f *File) Get(key string) ([]byte, error)

func (*File) Set added in v0.9.1

func (f *File) Set(key string, value []byte) error

type KV

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

func New

func New(opts Options) (KV, error)

type Memory added in v0.9.1

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

func NewMemory added in v0.9.1

func NewMemory() *Memory

func (*Memory) Delete added in v0.9.1

func (m *Memory) Delete(key string) error

func (*Memory) Get added in v0.9.1

func (m *Memory) Get(key string) ([]byte, error)

func (*Memory) Set added in v0.9.1

func (m *Memory) Set(key string, value []byte) 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