Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { URL string // base URL of form http://ipaddr:port with no trailing slash Listener net.Listener TLS *tls.Config // nil if not using using TLS // Config may be changed after calling NewUnstartedServer and // before Start or StartTLS. Config *server.Server // contains filtered or unexported fields }
A Server is an HTTP server listening on a system-chosen port on the local loopback interface, for use in end-to-end HTTP tests.
func NewServer ¶
NewServer starts and returns a new Server. The caller should call Close when finished, to shut it down.
func NewTLSServer ¶
NewTLSServer starts and returns a new Server using TLS. The caller should call Close when finished, to shut it down.
func NewUnstartedServer ¶
NewUnstartedServer returns a new Server but doesn't start it.
After changing its configuration, the caller should call Start or StartTLS.
The caller should call Close when finished, to shut it down.
func (*Server) Close ¶
func (s *Server) Close()
Close shuts down the server and blocks until all outstanding requests on this server have completed.
func (*Server) CloseClientConnections ¶
func (s *Server) CloseClientConnections()
CloseClientConnections closes any currently open HTTP connections to the test Server.