cache

package
v0.0.0-...-7c09993 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCacheMiss = errors.New("Cache miss")

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(key string, value []byte) error
	Get(key string) ([]byte, error)
}

type MemoryCache

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

func NewMemoryCache

func NewMemoryCache() MemoryCache

func (MemoryCache) Get

func (m MemoryCache) Get(key string) ([]byte, error)

func (MemoryCache) Set

func (m MemoryCache) Set(key string, payload []byte) error

type NoopCache

type NoopCache struct {
}

func NewNoopCache

func NewNoopCache() *NoopCache

func (*NoopCache) Get

func (c *NoopCache) Get(key string) ([]byte, error)

func (*NoopCache) Set

func (c *NoopCache) Set(key string, payload []byte) error

type RedisCache

type RedisCache struct {
	Pool *redigo.Pool
}

func NewRedisCache

func NewRedisCache(pool *redigo.Pool) *RedisCache

func (*RedisCache) Get

func (c *RedisCache) Get(key string) ([]byte, error)

func (*RedisCache) Set

func (c *RedisCache) Set(key string, value []byte) error

Jump to

Keyboard shortcuts

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