Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wrapper http.Server and net.Listener to make access to certain internal fields more easily accessible.
func NewServer ¶
NewServer creates an http server with a reverse proxy handler. We split the live server and proxy handler for testability.
func (*Server) Listen ¶
Listen creates a listener on the given address. It stores the listener for later calls to Serve, and to allow programmatic retrieval of the listening address for cases where it is randomized (e.g. ':0').
func (*Server) ListenAndServe ¶
ListenAndServe is a convenience method for Listen() and Serve(). Listen and Serve primarily make sense to call separately in testing, so the listener can allocate a port before we spin of Serve() in a goroutine. In production, you'd likely only need listen and server, unless you want programmatic access to the listener address (e.g. multiple servers).