Help us shape the future of Go! Take the 2026 Go Developer Survey

cache

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder func(cfg config.CacheConfig) (Store, error)

Builder creates a cache Store from configuration.

func DefaultBuilder

func DefaultBuilder() Builder

DefaultBuilder returns a builder that constructs a noop cache.

type Entry

type Entry struct {
	Data       []byte
	StoredAt   time.Time
	Attributes map[string]any
}

Entry encapsulates cached payload.

type Store

type Store interface {
	Get(ctx context.Context, key string) (Entry, bool, error)
	Set(ctx context.Context, key string, entry Entry) error
}

Store defines minimal cache functionality.

Jump to

Keyboard shortcuts

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