cache

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheSeparator = "|"
)

Variables

View Source
var (
	ErrMiss = cache.ErrCacheMiss

	DefaultTTL = 5 * time.Minute
)

Functions

func KeyFromParts

func KeyFromParts(parts ...string) string

Types

type Cache

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

func New

func New(redisConn *redis.Client) *Cache

func (*Cache) Get

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

func (*Cache) Set

func (c *Cache) Set(ctx context.Context, key string, bytes []byte, ttl time.Duration) error

Jump to

Keyboard shortcuts

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