Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServer ¶ added in v0.6.0
type HTTPServer struct {
// contains filtered or unexported fields
}
func New ¶
func New(config server.Config, opts ...Option) (*HTTPServer, error)
New creates an HTTP server with a default handler and has not started to accept requests yet.
func (*HTTPServer) Handle ¶ added in v0.6.0
func (s *HTTPServer) Handle(mux http.Handler)
Handle associates the given handler with the server.
func (*HTTPServer) Serve ¶ added in v0.6.0
func (s *HTTPServer) Serve(result chan<- error)
Serve accepts incoming connections, creating a new service goroutine for each. The service goroutine reads requests and then call the handler to reply to them.
func (*HTTPServer) Stop ¶ added in v0.6.0
func (s *HTTPServer) Stop()
Stop shuts down the http server gracefully without interrupting an active connections.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option provides options for configuring the creation of a http server.
func WithLogger ¶
WithLogger will add logging to the http server.
Click to show internal directories.
Click to hide internal directories.