Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTP ¶
type HTTP struct { // StopTimeout is the duration before we begin force closing connections. // Defaults to 1 minute. StopTimeout time.Duration // KillTimeout is the duration before which we completely give up and abort // even though we still have connected clients. This is useful when a large // number of client connections exist and closing them can take a long time. // Note, this is in addition to the StopTimeout. Defaults to 1 minute. KillTimeout time.Duration }
HTTP defines the configuration for serving a http.Server. Multiple calls to Serve or ListenAndServe can be made on the same HTTP instance. The default timeouts of 1 minute each result in a maximum of 2 minutes before a Stop() returns.
type Server ¶
type Server interface { // Wait waits for the serving loop to finish. This will happen when Stop is // called, at which point it returns no error, or if there is an error in the // serving loop. You must call Wait after calling Serve or ListenAndServe. Wait() error // Stop stops the listener. It will block until all connections have been // closed. Stop() error }
A Server allows encapsulates the process of accepting new connections and serving them, and gracefully shutting down the listener without dropping active connections.
Click to show internal directories.
Click to hide internal directories.