backend

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 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.

type ValueUnmarshaler added in v0.3.0

type ValueUnmarshaler interface {
	UnmarshalValue(ctx context.Context, key string, to interface{}) error
}

A ValueUnmarshaler decodes a value identified by a key into a target.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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