prefix

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend loads keys using prefix.

func NewBackend

func NewBackend(prefix string, backend backend.Backend, opts ...Option) *Backend

NewBackend creates a new prefix backend.

func (*Backend) Get

func (b *Backend) Get(ctx context.Context, key string) ([]byte, error)

Get loads the given key using specified key prefix and backend.

func (*Backend) Name

func (b *Backend) Name() string

Name returns the name of the backend.

type Option

type Option func(*Backend)

Option is used to configure the prefix backend.

func WithDelimiter

func WithDelimiter(delimiter string) Option

WithDelimiter allows to specify a delimiter between prefix and key.

Jump to

Keyboard shortcuts

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