storage

package
v0.0.0-...-c6e3130 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type DB

type DB interface {
	// Get returns the value for the given key, ErrNotFound if the key doesn't exist,
	// or another error if the get failed
	Get(key string) ([]byte, error)
	// Set sets the value for the given key. Returns an error if the set failed.
	// If non-nil error is returned, the value was not updated
	Set(key string, val []byte) error
}

DB is the interface to a simple key/value store

func NewInMemoryDB

func NewInMemoryDB() DB

NewInMemoryDB creates a new DB implementation that stores all data in memory. All operations are concurrency safe

Jump to

Keyboard shortcuts

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