cache

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: AGPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFoundKey = errors.NewKind("Unable to find the given key, %s")

Functions

This section is empty.

Types

type ValidableCache

type ValidableCache struct {
	httpcache.Cache
	// contains filtered or unexported fields
}

ValidableCache represents a cache, were each new entry should be validate before be read or write a new entry, otherwise is forget and discarded.

func NewValidableCache

func NewValidableCache(cache httpcache.Cache) *ValidableCache

NewValidableCache returns a new ValidableCache based on the given cache.

func (*ValidableCache) Set

func (c *ValidableCache) Set(key string, responseBytes []byte)

Set stores the []byte representation of a response against a key. This data is stored in a temporal space, if isn't validate before `Set` is called again, the information get lost.

func (*ValidableCache) Validate

func (c *ValidableCache) Validate(key string) error

Validate validates the given key as a valid cache entry,

Jump to

Keyboard shortcuts

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