Versions in this module Expand all Collapse all v0 v0.0.1 Oct 31, 2016 Changes in this version + var Client = &http.Client + var ClientFasthttp = &fasthttp.Client + var Default = NewService(defaultStore) + var Fasthttp = NewServiceFasthttp(defaultStore) + var GC = 30 * time.Minute + func Cache(bodyHandler http.Handler, expiration time.Duration) http.Handler + func Clear() + func Invalidate(req *http.Request) + func Request(remoteURL string, bodyHandler http.Handler, expiration time.Duration) http.Handler + func RequestFasthttp(remoteURL string, bodyHandler fasthttp.RequestHandler, ...) fasthttp.RequestHandler + func ServeHTTP(res http.ResponseWriter, req *http.Request) + type Entry struct + Body []byte + ContentType string + Expires time.Time + StatusCode int + type Service struct + func NewService(store Store) *Service + func (s *Service) Cache(bodyHandler http.Handler, expiration time.Duration) http.Handler + func (s *Service) Clear() + func (s *Service) Invalidate(req *http.Request) + func (s *Service) ServeHTTP(res http.ResponseWriter, req *http.Request) + type ServiceFasthttp struct + func NewServiceFasthttp(store Store) *ServiceFasthttp + func (s *ServiceFasthttp) Cache(bodyHandler fasthttp.RequestHandler, expiration time.Duration) fasthttp.RequestHandler + func (s *ServiceFasthttp) Clear() + func (s *ServiceFasthttp) Invalidate(reqCtx *fasthttp.RequestCtx) + func (s *ServiceFasthttp) ServeHTTP(reqCtx *fasthttp.RequestCtx) + type Store interface + Clear func() + Get func(key string) *Entry + Remove func(key string) + Set func(key string, statusCode int, cType string, body []byte, ...) + func NewMemoryStore(gcDuration time.Duration) Store