Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestServer ¶
type TestServer struct { Port int // contains filtered or unexported fields }
TestServer wraps a http.Server that runs on a separate goroutine and is intended for unit testing.
func CreateAndStart ¶
func CreateAndStart(port int, mux *http.ServeMux) (*TestServer, error)
CreateAndStart creates and returns a TestServer that waits for web requests on the provided port using the provided multiplexer on a different goroutine.
If the port is 0, a port number is dynamically chosen. This port can be retrieved by checking the Port field of the TestServer struct.
func (TestServer) Stop ¶
func (ms TestServer) Stop()
Stop immediately closes all connections and shuts down the server.
Click to show internal directories.
Click to hide internal directories.