storage

package
v0.0.0-...-0d2c564 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound returns when a key is not
	// found in the storage.
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Storage

type Storage interface {
	Set(ctx context.Context, key, value interface{})
	Get(key interface{}) (value interface{}, err error)
}

Storage represents abstraction for key/value storage.

func New

func New() Storage

New returns initialized storage implementation. When context of the Set method will be done, storage will remove key from it. When the same key will be passed to the Get method, previous context done wait will be expired.

Jump to

Keyboard shortcuts

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