database

package
v0.0.0-...-1082322 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factories = map[string]func(conf Conf) (DB, error){}

Factories of database

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Driver string
	Source string
}

Conf the configuration of database

type DB

type DB interface {
	Conf() Conf

	Set(kv *KV) error
	Get(key string) (*KV, error)
	Del(key string) error
	List(prefix string) ([]KV, error)

	io.Closer
}

DB the backend database

func New

func New(conf Conf) (DB, error)

New KV database by given name

type KV

type KV struct {
	Key   string
	Value []byte
}

Jump to

Keyboard shortcuts

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