kv_kvs

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidKey = errors.New("invalid key")
	ErrorNotFound   = errors.New("key not found")
)

Functions

This section is empty.

Types

type Kvs

type Kvs interface {
	PutString(key string, value string) error
	PutJson(key string, j json.RawMessage) error
	PutJsonModel(key string, v interface{}) error

	GetString(key string) (value string, err error)
	GetJson(key string) (j json.RawMessage, err error)
	GetJsonModel(key string, v interface{}) (err error)

	Delete(key string) error
	ForEach(f func(key string, value []byte) error) error
	ForEachRaw(f func(key, value []byte) error) error
	ForEachModel(model interface{}, f func(key string, m interface{}) error) error
}

Key-value store interface.

Jump to

Keyboard shortcuts

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