package server import ( "net/http" "time" ) // RequestTimeout exports the handler execution budget applied by // chimw.Timeout in SetupRoutes, so tests can assert the relationship // between it and the server's WriteTimeout. const RequestTimeout time.Duration = requestTimeout // SetListenPort overrides the port Run binds. A test uses it to hand // Run an unbindable port so ListenAndServe fails immediately and Run // returns after storing its http.Server. func SetListenPort(s *Server, port int) { s.port = port } // HTTPServerOf returns the http.Server that Run built and stored, so a // test can inspect the timeouts the running server actually carries. func HTTPServerOf(s *Server) *http.Server { return s.httpServer }