Versions in this module Expand all Collapse all v0 v0.2.0 Feb 12, 2017 Changes in this version + func Cacheable(req *http.Request, resp *http.Response) bool + type Cache struct + History *list.List + Max uint64 + URLVars map[URLKey]*Variations + func (c *Cache) Get(req *http.Request) *CachedResponse + func (c *Cache) Set(req *http.Request, cached *CachedResponse) + type CachedResponse struct + Body []byte + Element *list.Element + Header http.Header + RequestTime time.Time + ResponseTime time.Time + func NewCachedResponse(resp *http.Response, reqTime, respTime time.Time) (*CachedResponse, error) + func (e *CachedResponse) Response() *http.Response + type CachedState int + const Fresh + const Miss + const Revalidate + const Stale + type Transport struct + OriginChangedAt time.Time + func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) + func (t *Transport) State(req *http.Request, cached *CachedResponse) (CachedState, time.Duration) + type URLKey struct + Host string + Method string + Path string + Query string + func NewURLKey(req *http.Request) URLKey + type VarKey string + func NewVarKey(pe *Variations, req *http.Request) VarKey + type Variations struct + Fields []string + VarResponse map[VarKey]*CachedResponse + func NewVariations(resp *CachedResponse) *Variations