cache

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound   = errors.New("cache not found")
	ErrInvalidTTL = errors.New("invalid TTL provided")
	ErrAddFailed  = errors.New("failed to add key/value to cache")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// Get returns the value associated with the key, or an error if not found.
	Get(ctx context.Context, key string) (any, error)

	// Set stores a value with the specified key.
	Set(ctx context.Context, key string, value any) error

	// Delete removes the specified key/value from the cache.
	Delete(ctx context.Context, key string) error
}

Cache is the main interface for a generic key-value cache.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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