Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultReadHeaderTimeout defines the default timeout for reading headers. DefaultReadHeaderTimeout = 2 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Acme bool
Port int
Cert string
Key string
AcmeHost string
ReadHeaderTimeout time.Duration
}
Config defines the config of an http server. TODO: expose via options?
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a wrapper around http.Server that exposes different async ListenAndServe methods that return corresponding ShutdownFunctions.
func (*Server) ListenAndServe ¶
func (s *Server) ListenAndServe() (*errgroup.Group, ShutdownFunction)
ListenAndServe initializes a server to respond to HTTP network requests.
func (*Server) ListenAndServeMTLS ¶
func (s *Server) ListenAndServeMTLS() (*errgroup.Group, ShutdownFunction)
type ShutdownFunction ¶
ShutdownFunction defines a function that is called to shutdown the server.
Click to show internal directories.
Click to hide internal directories.