Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServiceStatusVerifier ¶
func NewServiceStatusVerifier(s ServiceStatus, delegate http.Handler) http.Handler
NewServiceStatusVerifier is a http.Handler that checks if the service is ready to serve, and if so, chain the Delegate handler, otherwise call's the Error handler it returns an error
Types ¶
type ServiceReadyVerifier ¶
type ServiceReadyVerifier struct { Status ServiceStatus Delegate http.Handler Error http.Handler }
ServiceReadyVerifier is a http.Handler that checks if the service is ready to serve, and if so, chain the Delegate handler, otherwise call's the Error handler
func (*ServiceReadyVerifier) ServeHTTP ¶
func (c *ServiceReadyVerifier) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the http.Handler interface
type ServiceStatus ¶
type ServiceStatus interface {
IsReady() bool
}
ServiceStatus specifies an interface to check if the service is ready to serve requests
Click to show internal directories.
Click to hide internal directories.