cache

package
v0.0.0-...-73c8273 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCacheMiss   = errors.New("cache: key not found")
	ErrCacheFailed = errors.New("cache: failed to get key")
	ErrUnmarshal   = errors.New("cache: failed to unmarshal data")
	ErrMarshal     = errors.New("cache: failed to marshal data")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(key string, value interface{}) error
	Set(key string, value interface{}, expiration time.Duration) error
	Delete(key string) error
	DeletePattern(pattern string) error
}

type ImplCache

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

func NewCache

func NewCache(client *redis.Client) *ImplCache

func (*ImplCache) Delete

func (c *ImplCache) Delete(key string) error

func (*ImplCache) DeletePattern

func (c *ImplCache) DeletePattern(pattern string) error

func (*ImplCache) Get

func (c *ImplCache) Get(key string, value interface{}) error

func (*ImplCache) Set

func (c *ImplCache) Set(key string, value interface{}, expiration time.Duration) error

Jump to

Keyboard shortcuts

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