Documentation ¶
Index ¶
- type Server
- func (s *Server) AddContext(parent context.Context, next http.Handler) http.Handler
- func (s *Server) AddRoutes(ctx context.Context, router *mux.Router, chain alice.Chain) http.Handler
- func (s *Server) HealthCheckHandler(rw http.ResponseWriter, req *http.Request)
- func (s *Server) Serve(ctx context.Context) error
- func (s *Server) WithMetrics(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is our HTTP server implementation.
func NewServer ¶
NewServer constructs a server from the provided parameters.
func (*Server) AddContext ¶
AddContext adds the accociated server's context to the provided http.Hander request.
func (*Server) AddRoutes ¶
AddRoutes add the accociated Servers URL routes to the provided router with the provided context.Context.
func (*Server) HealthCheckHandler ¶
func (s *Server) HealthCheckHandler(rw http.ResponseWriter, req *http.Request)
HealthCheckHandler a http handler return 200 OK when server health is fine.
func (*Server) Serve ¶
Serve starts all the accociated servers resources and listeners and blocks forever until signals or error occurs. Returns error and gracefully stops all HTTP listeners before return.
Click to show internal directories.
Click to hide internal directories.