cachestore

package
v0.0.0-...-919b350 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCacheMiss is returned by CacheStore.Load calls when there is no entry in store for a given key.
	ErrCacheMiss = errors.New("cache miss")

	// ErrInvalidCacheResponse is returned by CacheStore.Load calls in case of cache entry corruption.
	ErrInvalidCacheResponse = errors.New("invalid cache response")
)

Functions

This section is empty.

Types

type CacheStore

type CacheStore interface {
	Save(key string, response *Response) error
	Load(key string) (*Response, error)
}

CacheStore acts as a storage for HTTPCache.

type Response

type Response struct {
	StatusCode int
	Header     http.Header
	Body       []byte
}

Response is used to store HTTP response in cache.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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