gocondcache

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("cache item not found")
)

Functions

func New

func New(cache Cache) func(http.RoundTripper) http.RoundTripper

NewETAG placeholder

Types

type Cache

type Cache interface {
	Get(ctx context.Context, k string) (*CacheItem, error)
	Set(ctx context.Context, k string, v *CacheItem) error
}

type CacheItem

type CacheItem struct {
	ETAG       string
	Response   []byte
	Expiration time.Time // NOTE : look to see if expiration needs to be set from cache-control headers
}

type CacheTransport

type CacheTransport struct {
	Wrapped http.RoundTripper
	// contains filtered or unexported fields
}

func (*CacheTransport) RoundTrip

func (c *CacheTransport) RoundTrip(r *http.Request) (*http.Response, error)

Directories

Path Synopsis
caches

Jump to

Keyboard shortcuts

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