Versions in this module Expand all Collapse all v1 v1.1.0 Nov 15, 2014 v1.0.0 Nov 13, 2014 Changes in this version + const CacheControlHeader + const CacheHeader + const ProxyDateHeader + var Clock = func() time.Time + var DebugLogging = false + var ErrNotFoundInCache = errors.New("Not found in cache") + var Writes sync.WaitGroup + func Debugf(format string, args ...interface{}) + func Errorf(format string, args ...interface{}) + func Fatal(args ...interface{}) + func Fatalf(format string, args ...interface{}) + type Cache struct + func NewCache(fs vfs.VFS) *Cache + func NewDiskCache(dir string) (*Cache, error) + func NewMemoryCache() *Cache + func (c *Cache) Freshen(res *Resource, keys ...string) error + func (c *Cache) Header(key string) (Header, error) + func (c *Cache) Invalidate(keys ...string) + func (c *Cache) Retrieve(key string) (*Resource, error) + func (c *Cache) Store(res *Resource, keys ...string) error + type CacheControl map[string][]string + func ParseCacheControl(input string) (CacheControl, error) + func ParseCacheControlHeaders(h http.Header) (CacheControl, error) + func (cc CacheControl) Add(key, val string) + func (cc CacheControl) Duration(key string) (time.Duration, error) + func (cc CacheControl) Get(key string) (string, bool) + func (cc CacheControl) Has(key string) bool + func (cc CacheControl) String() string + type Handler struct + Shared bool + func NewHandler(cache *Cache, upstream http.Handler) *Handler + func (h *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request) + type Header struct + StatusCode int + type Key struct + func NewKey(method string, u *url.URL, h http.Header) Key + func NewRequestKey(r *http.Request) Key + func (k Key) ForMethod(method string) Key + func (k Key) String() string + func (k Key) Vary(varyHeader string, r *http.Request) Key + type ReadSeekCloser interface + type Resource struct + RequestTime time.Time + ResponseTime time.Time + func NewResource(statusCode int, body ReadSeekCloser, hdrs http.Header) *Resource + func NewResourceBytes(statusCode int, b []byte, hdrs http.Header) *Resource + func (r *Resource) Age() (time.Duration, error) + func (r *Resource) DateAfter(d time.Time) bool + func (r *Resource) Expires() (time.Time, error) + func (r *Resource) HasExplicitExpiration() bool + func (r *Resource) HasValidators() bool + func (r *Resource) Header() http.Header + func (r *Resource) HeuristicFreshness() time.Duration + func (r *Resource) IsStale() bool + func (r *Resource) LastModified() time.Time + func (r *Resource) MarkStale() + func (r *Resource) MaxAge(shared bool) (time.Duration, error) + func (r *Resource) MustValidate(shared bool) bool + func (r *Resource) Status() int + func (r *Resource) Via() string + func (r *Resource) Warnings() ([]string, error) + type Validator struct + Handler http.Handler + func (v *Validator) Validate(req *http.Request, res *Resource) bool