backend

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned by the backends given key is not found.
	ErrNotFound = errors.New("key not found")
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Name() string
}

A Backend is used to fetch values from a given key.

func Func

func Func(name string, fn func(context.Context, string) ([]byte, error)) Backend

Func creates a Backend from a function.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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