Documentation ¶
Index ¶
- Constants
- func GetKeyForRequest(req *http.Request) string
- func New(config *ServerConfig) lib.Server
- type Cache
- type CacheReader
- type Server
- func (s *Server) Cache(req *http.Request, res *http.Response, body []byte) error
- func (s *Server) CacheAsync(req *http.Request, res *http.Response, body []byte, callback func(error))
- func (s *Server) Close() error
- func (s *Server) Fetch(req *http.Request) (*http.Response, error)
- func (s *Server) FetchFromCache(req *http.Request) (*http.Response, error)
- func (s *Server) FetchFromServer(req *http.Request) (*http.Response, error)
- func (s *Server) FetchRawFromCache(key string) ([]byte, error)
- func (s *Server) HasCache(req *http.Request) bool
- func (s *Server) Listener() net.Listener
- func (s *Server) Open(addr string) (net.Listener, error)
- func (s *Server) RedisAvailable() bool
- func (s *Server) Running() bool
- func (s *Server) ServeAsAPI(w http.ResponseWriter, req *http.Request)
- func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (s *Server) ServeHTTPUnsafe(w http.ResponseWriter, req *http.Request)
- func (s *Server) ShouldCache(req *http.Request, res *http.Response) bool
- func (s *Server) WaitGroup() *sync.WaitGroup
- type ServerConfig
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func GetKeyForRequest ¶
func New ¶
func New(config *ServerConfig) lib.Server
Types ¶
type CacheReader ¶
func (*CacheReader) Close ¶
func (c *CacheReader) Close() error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CacheAsync ¶
func (*Server) FetchFromCache ¶
func (*Server) FetchFromServer ¶
func (*Server) RedisAvailable ¶
func (*Server) ServeAsAPI ¶
func (s *Server) ServeAsAPI(w http.ResponseWriter, req *http.Request)
func (*Server) ServeHTTPUnsafe ¶
func (s *Server) ServeHTTPUnsafe(w http.ResponseWriter, req *http.Request)
func (*Server) ShouldCache ¶
Click to show internal directories.
Click to hide internal directories.