Documentation ¶
Index ¶
- Constants
- Variables
- type Listener
- type Listeners
- type Server
- func (s *Server) Await()
- func (s *Server) CacheConfigHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) CacheConfigUpdateHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) CacheFlushHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) CacheInvalidateHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) CacheKeyPurgeHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) CacheKeysHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) Director() func(req *http.Request)
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) Shutdown()
- func (s *Server) Start(ctx context.Context)
- func (s *Server) Stop()
- type Target
- type Targets
Constants ¶
const ( DefaultTimeout = 30 * time.Second ServerGracefulShutdownTimeout = 5 * time.Second )
Variables ¶
var ErrMatchingTarget = fmt.Errorf("no matching target found")
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener is the Listen server.
func NewListener ¶
type Listeners ¶
Listeners holds a map of Listeners.
func NewListeners ¶
NewListeners creates new listeners.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the reverse proxy cache.
func NewServer ¶
func NewServer(cfg *config.Configuration, pdr provider.Provider, httpcache *cache.HttpCache) (*Server, error)
NewServer creates a new configured server.
func (*Server) CacheConfigHandler ¶
func (s *Server) CacheConfigHandler(w http.ResponseWriter, r *http.Request)
CacheConfigHandler renders the current cache config.
func (*Server) CacheConfigUpdateHandler ¶
func (s *Server) CacheConfigUpdateHandler(w http.ResponseWriter, r *http.Request)
CacheConfigHandler renders the current cache config.
func (*Server) CacheFlushHandler ¶
func (s *Server) CacheFlushHandler(w http.ResponseWriter, r *http.Request)
CacheFlushHandler handles the DELETE request to flush all keys from the cache.
func (*Server) CacheInvalidateHandler ¶ added in v0.2.0
func (s *Server) CacheInvalidateHandler(w http.ResponseWriter, r *http.Request)
CacheInvalidateHandler handles the DELETE request to invalidate the provided key in the cache. When running in a cluster, this does not broadcast to other kache instances.
func (*Server) CacheKeyPurgeHandler ¶
func (s *Server) CacheKeyPurgeHandler(w http.ResponseWriter, r *http.Request)
CacheKeyPurgeHandler handles a PURGE request and deletes the given key from the cache. The cache key is obtained from a custom request header 'X-Purge-Key'. When running in a cluster a invalidation signal gets broadcasted to other instances.
func (*Server) CacheKeysHandler ¶
func (s *Server) CacheKeysHandler(w http.ResponseWriter, r *http.Request)
CacheKeysHandler renders all cache keys in JSON format.
func (*Server) Director ¶
Director matches the incoming request to a specific target and sets the request object to be sent to the matched upstream server.
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
Target holds information about the upstream target.
type Targets ¶
type Targets []*Target
Targets holds an array of targets.
func NewTargets ¶
NewTargets creates new upstream targets.