backend

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 2 Imported by: 43 modules, 76 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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