Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer wraps the default net/http server to add the ability to use middlewares and support for the supervisor.Service interface.
func (*HTTPServer) Addr ¶
func (s *HTTPServer) Addr() net.Addr
Addr returns the server's network address.
func (*HTTPServer) ServeHTTP ¶
func (s *HTTPServer) ServeHTTP(rw http.ResponseWriter, r *http.Request)
ServeHTTP prepares middlewares stack if necessary and calls ServerHTTP on the wrapped server.
func (*HTTPServer) SetHandler ¶ added in v0.9.0
func (s *HTTPServer) SetHandler(handler http.Handler)
SetHandler sets the handler for the server.
func (*HTTPServer) Start ¶
func (s *HTTPServer) Start(ctx context.Context) error
Start implements the supervisor.Service interface. It starts HTTP server.
func (*HTTPServer) Use ¶
func (s *HTTPServer) Use(m ...Middleware)
Use adds a middleware. Middlewares will be called in the reverse order they were added.
func (*HTTPServer) Wait ¶
func (s *HTTPServer) Wait() <-chan error
Wait implements the supervisor.Service interface.
Click to show internal directories.
Click to hide internal directories.