cache

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTP

func HTTP(maxCacheSizeMiB int64, maxCacheAge time.Duration) httpcache.Cache

Types

type Cache

type Cache interface {
	Get(key string, result interface{}) (hit bool, err error)
	Set(key string, value interface{}, duration time.Duration) error
	GetOrSet(key string, result interface{}, duration time.Duration, fetch func() (interface{}, error)) error
}

func Hybrid

func Hybrid(local, remote Cache) Cache

func NewMemory

func NewMemory() Cache

type Stale

type Stale interface {
	Cache
	GetStale(key string, result interface{}) (hit bool, err error)
}

func WithStaleFallback

func WithStaleFallback(storage Cache, staleTTL time.Duration) Stale

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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