Documentation
¶
Index ¶
- type Check
- type HandlerMux
- type Server
- func (s *Server) RegisterCheck(name string, checkFn func() (bool, string))
- func (s *Server) RegisterOnMux(mux HandlerMux)
- func (s *Server) SetReady(ready bool)
- func (s *Server) SetReloadFunc(fn func() error)
- func (s *Server) Start() error
- func (s *Server) StartContext(ctx context.Context) error
- func (s *Server) Stop(ctx context.Context) error
- type StatusResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerMux ¶
type HandlerMux interface {
Handle(pattern string, handler http.Handler)
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
}
HandlerMux is the interface for registering HTTP handlers, used by RegisterOnMux so that callers can pass any mux implementation (e.g. *http.ServeMux or a custom dynamic mux).
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RegisterCheck ¶
func (*Server) RegisterOnMux ¶
func (s *Server) RegisterOnMux(mux HandlerMux)
RegisterOnMux registers /health, /ready and /reload handlers onto the given mux. This allows the health endpoints to be served by a shared HTTP server.
func (*Server) SetReloadFunc ¶
SetReloadFunc sets the callback function for config reload.
Click to show internal directories.
Click to hide internal directories.