storage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

ErrStoreNotFound is used when a given store was not found in a provider.

View Source
var ErrValueNotFound = errors.New("store does not have a value associated with this key")

ErrValueNotFound is used when an attempt is made to retrieve a value from key

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// OpenStore opens a store with the given name and returns it.
	OpenStore(name string) (Store, error)

	// CloseStore closes the store with the given name.
	CloseStore(name string) error

	// Close closes all stores created under this store provider.
	Close() error
}

Provider represents a storage provider.

type Store

type Store interface {
	// Put stores the key-record pair.
	Put(k string, v []byte) error

	// Get fetches the record associated with the given key.
	Get(k string) ([]byte, error)
}

Store represents a storage database.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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