cache

package module
v0.0.0-...-c330695 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCacheMiss = xerrors.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

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

BigCache initializes a bigcache implementation wrapper

func Redis

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

Redis initializes a redis cache implementation wrapper

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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