cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCacheMiss = errors.New("cache: item not found")

ErrCacheMiss is raised when item is not found in cache

Functions

This section is empty.

Types

type Storage

type Storage interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Set(ctx context.Context, key string, value []byte, duration time.Duration) error
	Remove(ctx context.Context, key string) error
}

Storage describes cache storage contract

func BigCache added in v1.0.0

func BigCache(cfg bigcache.Config) (Storage, error)

BigCache initializes a bigcache implementation wrapper

func Redis added in v1.0.0

func Redis(client *redis.Client, namespace string) (Storage, error)

Redis initializes a redis cache implementation wrapper

Jump to

Keyboard shortcuts

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