Versions in this module Expand all Collapse all v2 v2.0.0 Sep 15, 2020 Changes in this version + const XFromCache + var ErrNoDateHeader = errors.New("no Date header") + func CachedResponse(c Cache, req *http.Request) (resp *http.Response, err error) + func Date(respHeaders http.Header) (date time.Time, err error) + type Cache interface + Delete func(key string) + Get func(key string) (responseBytes []byte, ok bool) + Set func(key string, responseBytes []byte, ttl int) + type CacheOptions struct + Debug bool + MarkCachedResponses bool + TTL int + type CachedClient struct + Cache Cache + Options CacheOptions + Transport http.RoundTripper + func (cc *CachedClient) Do(req *http.Request) (resp *http.Response, err error) + type ClientOptions struct + type Doer interface + Do func(req *http.Request) (*http.Response, error) + func NewCachedClient(client *http.Client, c Cache, options CacheOptions) Doer + func NewMapCachedClient(client *http.Client) Doer + type MemoryCache struct + func NewMemoryCache() *MemoryCache + func (mc *MemoryCache) Delete(key string) + func (mc *MemoryCache) Get(key string) (resp []byte, ok bool) + func (mc *MemoryCache) Set(key string, resp []byte, ttl int) Other modules containing this package github.com/lggomez/httpcache