cache

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("cache key not found")

Functions

This section is empty.

Types

type Cache

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

func New

func New(cfg Config) (*Cache, error)

func (*Cache) Add

func (c *Cache) Add(ctx context.Context, entry capstore.Entry) error

func (*Cache) Close

func (c *Cache) Close() error

func (*Cache) Delete

func (c *Cache) Delete(ctx context.Context, key string) error

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, key string) (capstore.Entry, error)

func (*Cache) GetOrSet

func (c *Cache) GetOrSet(ctx context.Context, key string, ttl time.Duration, load capstore.Loader) (capstore.Entry, error)

func (*Cache) List

func (c *Cache) List(ctx context.Context, prefix string) ([]capstore.Entry, error)

func (*Cache) Set

func (c *Cache) Set(ctx context.Context, entry capstore.Entry) error

type Config

type Config struct {
	Namespace string
	Redis     capredis.Client
	Store     capstore.Store
	Fallback  bool
}

Jump to

Keyboard shortcuts

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