cache

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 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 = errors.New("not found")

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(ctx context.Context, key string, value string) error
	SetWithTTL(ctx context.Context, key string, value string, ttl time.Duration) error
	Get(ctx context.Context, key string) (string, error)
	GetTTL(ctx context.Context, key string) (time.Duration, error)
	Del(ctx context.Context, key string)
}

func NewInmemoryWithRedisOrInmemory

func NewInmemoryWithRedisOrInmemory(ctx context.Context, cfg config.Cache) (Cache, error)

func NewRedis added in v0.59.0

func NewRedis(ctx context.Context, cfg *config.Redis) (Cache, error)

func NewRedisOrInmemory

func NewRedisOrInmemory(ctx context.Context, cfg config.Cache) (Cache, error)

Directories

Path Synopsis
Package mock_cache is a generated GoMock package.
Package mock_cache is a generated GoMock package.

Jump to

Keyboard shortcuts

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