Documentation ¶
Overview ¶
Provides HTTP server implementation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
Server is an object representing gin.Engine and implementing the lifecycle.Service interface.
func NewServer ¶
NewServer create new Server using global configuration and provided options. Function reads "http.address" config key to determine an address for HTTP listener (by default: 0.0.0.0:8080). Other config keys are "http.security.headers" which controls whether server should automatically include HTTP security headers to its responses and "http.shutdown.timeout" which defines a maximum time of shutdown in seconds.
type ServerOpt ¶
type ServerOpt = func(*serverConfig)
ServerOpt is an option to be specified to NewServer.
func CustomConfig ¶
func CustomConfig(customConfig *config.Config) ServerOpt
CustomConfig makes NewServer overwrite keys from global configuration with these from the specified one.
func SecurityHeaders ¶
SecurityHeaders defines whether to include HTTP security headers to all responses or not
func ShutdownTimeout ¶
ShutdownTimeout defines a maximal timeout of HTTP server shutdown