Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultShutdownTimeout is the default ShutdownTimeout (see Config). DefaultShutdownTimeout = time.Second * 10 )
Variables ¶
This section is empty.
Functions ¶
func BaseTLSConfig ¶ added in v1.8.0
BaseTLSConfig returns a tls.Config with some good default settings for security.
Types ¶
type Config ¶
type Config struct {
// Name is the name of the server. It is only used for logging. It can
// be empty.
Name string
// Address is the address to bind the server to. It must be set.
Address string
// AddressTLS is the address to bind the https server to. It must be set, but is not used if TLS is not configured.
AddressTLS string
// TLSConfig is the TLS configuration for the server. It is optional.
TLSConfig *TLSConfig
// ShutdownTimeout controls how long to wait for requests to finish before
// returning from Run() after the context is canceled. It defaults to
// 10 seconds if unset. If set to a negative value, the server will be
// closed immediately.
ShutdownTimeout time.Duration
}
Config holds the HTTP server configuration.
Click to show internal directories.
Click to hide internal directories.