cache

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFound = errors.New("not found")

Functions

func IsNotFound

func IsNotFound(err error) bool

Types

type Cache

type Cache interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Set(ctx context.Context, key string, value []byte) error
	Delete(ctx context.Context, key string) error
}

type InMemoryCache

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

InMemoryCache implements the cache.Cache interface for testing

func NewInMemoryCache

func NewInMemoryCache() *InMemoryCache

func (*InMemoryCache) Delete

func (m *InMemoryCache) Delete(ctx context.Context, key string) error

func (*InMemoryCache) Get

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

func (*InMemoryCache) Set

func (m *InMemoryCache) Set(ctx context.Context, key string, value []byte) error

Jump to

Keyboard shortcuts

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