cache

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound = errors.New("key not found")
	ErrKeyExpired  = errors.New("key expired")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	PutKey(ctx context.Context, key string, value any) error
	PutKeyTTL(ctx context.Context, key string, value any, ttl time.Duration) error
	GetKey(ctx context.Context, key string, receiver any) error
	GetAndDeleteKey(ctx context.Context, key string, receiver any) error
	DeleteKey(ctx context.Context, key string) error
}

func NewInMemoryCache

func NewInMemoryCache() Cache

Jump to

Keyboard shortcuts

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