Documentation ¶
Overview ¶
Package handlers provides several non-proxy handlers for use internally by other Trickster handlers
Index ¶
- func ConfigHandleFunc(conf *config.Config) func(http.ResponseWriter, *http.Request)
- func HandleBadGateway(w http.ResponseWriter, r *http.Request)
- func HandleBadRequestResponse(w http.ResponseWriter, r *http.Request)
- func HandleInternalServerError(w http.ResponseWriter, r *http.Request)
- func HandleLocalResponse(w http.ResponseWriter, r *http.Request)
- func HandleRedirectResponse(w http.ResponseWriter, r *http.Request)
- func PingHandleFunc(conf *config.Config) func(http.ResponseWriter, *http.Request)
- func PurgeKeyHandleFunc(conf *config.Config, from backends.Backends) func(http.ResponseWriter, *http.Request)
- func PurgePathHandlerFunc(conf *config.Config, from *backends.Backends) func(http.ResponseWriter, *http.Request)
- func ReloadHandleFunc(f reload.ReloaderFunc, conf *config.Config, wg *sync.WaitGroup, ...) func(http.ResponseWriter, *http.Request)
- func WithRedirects(ctx context.Context, rc int, rl string) context.Context
- type SwitchHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigHandleFunc ¶
ConfigHandleFunc responds to the HTTP request with the running configuration
func HandleBadGateway ¶
func HandleBadGateway(w http.ResponseWriter, r *http.Request)
HandleBadGateway responds to an HTTP Request with 502 Bad Gateway
func HandleBadRequestResponse ¶
func HandleBadRequestResponse(w http.ResponseWriter, r *http.Request)
HandleBadRequestResponse responds to an HTTP Request with 400 Bad Request
func HandleInternalServerError ¶
func HandleInternalServerError(w http.ResponseWriter, r *http.Request)
HandleInternalServerError responds to an HTTP Request with 500 Internal Server Error
func HandleLocalResponse ¶
func HandleLocalResponse(w http.ResponseWriter, r *http.Request)
HandleLocalResponse responds to an HTTP Request based on the local configuration without making any upstream requests
func HandleRedirectResponse ¶
func HandleRedirectResponse(w http.ResponseWriter, r *http.Request)
HandleRedirectResponse responds to an HTTP Request with a 302 Redirect with 30x code and Location header inserted into the context by a previous handler Requires redirectCode and redirectLocation have been set
func PingHandleFunc ¶
PingHandleFunc responds to an HTTP Request with 200 OK and "pong"
func PurgeKeyHandleFunc ¶
func PurgeKeyHandleFunc(conf *config.Config, from backends.Backends) func(http.ResponseWriter, *http.Request)
PurgeHandleFunc purges an object from a cache based on key.
func PurgePathHandlerFunc ¶
Types ¶
type SwitchHandler ¶
type SwitchHandler struct {
// contains filtered or unexported fields
}
SwitchHandler is an HTTP Wrapper that allows users to update the underlying handler in-place once associated with a net.Listener
func NewSwitchHandler ¶
func NewSwitchHandler(router http.Handler) *SwitchHandler
NewSwitchHandler returns a New *SwitchHandler
func (*SwitchHandler) Handler ¶
func (s *SwitchHandler) Handler() http.Handler
Handler returns the current router
func (*SwitchHandler) ServeHTTP ¶
func (s *SwitchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves an HTTP Request
func (*SwitchHandler) Update ¶
func (s *SwitchHandler) Update(h http.Handler)
Update atomically changes the underlying handler without impacting user requests or uptime
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package health provides an application-wide health handler endpoint that is usually mapped to /trickster/health and provides the health status of the application's configured proxy endpoints
|
Package health provides an application-wide health handler endpoint that is usually mapped to /trickster/health and provides the health status of the application's configured proxy endpoints |