Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultMaxHeaderBytes = 1 << 20 DefaultAddr = ":8080" DefaultReadTimeout = 20 * time.Second DefaultWriteTimeout = 20 * time.Second DefaultIdleTimeout = 120 * time.Second DefaultShutdownTimeout = 5 * time.Minute )
View Source
const UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:10.0) Gecko/20100101 Firefox/10.0"
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(httpCfg HTTPServerConfig, handler http.Handler, shutdownFn func()) *server
Types ¶
type HTTPServerConfig ¶
type HTTPServerConfig struct { // MaxHeaderBytes can be used to override the default of 1<<20. MaxHeaderBytes int // ReadTimeout can be used to override the default http Server timeout of 20s. // The string should be formatted like a time.Duration string. ReadTimeout time.Duration // WriteTimeout can be used to override the default http Server timeout of 20s. // The string should be formatted like a time.Duration string. WriteTimeout time.Duration // IdleTimeout can be used to override the default http Server timeout of 120s. // The string should be formatted like a time.Duration string. IdleTimeout time.Duration // ShutdownTimeout can be used to override the default http Server Shutdown timeout // of 5m. ShutdownTimeout time.Duration // Addr is the binding address the Server implementation will serve HTTP over. // The default is ":8080" Addr string }
HTTPServerConfig holds info required to configure a server.Server.
Click to show internal directories.
Click to hide internal directories.