cache

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCacheExpired = errors.New("cached value expired")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(ct Type, key string, value io.Reader) error
	Get(ct Type, key string, receiver io.Writer) error
}

type FsCache

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

func New

func New(logger *zap.Logger, rootDir string, maxAge time.Duration) FsCache

func (FsCache) Get

func (cache FsCache) Get(ct Type, key string, receiver io.Writer) error

func (FsCache) Set

func (cache FsCache) Set(ct Type, key string, value io.Reader) error

type Type

type Type int
const (
	TypeAvatar Type = iota
	TypeLists
)

Jump to

Keyboard shortcuts

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