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 (*Server) OnNoRoute ¶ added in v1.1.49
OnNoRoute sets a handler for requests that cannot be routed and would end up as 404s.
func (*Server) OnPanic ¶ added in v1.1.49
OnPanic sets a handler for requests that resulted in panic and would end up as 500s.
type ServerConfig ¶ added in v1.1.49
type ServerConfig struct { // Address is an address to bind server socket to (default: "0.0.0.0:8080"). Address string // SecurityHeaders defines whether to include HTTP security headers to all responses or not (default: true). SecurityHeaders bool // ShutdownTimeout defines a maximal timeout of HTTP server shutdown (default: 5s). ShutdownTimeout time.Duration }
ServerConfig holds a configuration for NewServer.
type ServerOpt ¶
type ServerOpt = func(*ServerConfig)
ServerOpt is an option to be specified to NewServer.
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.
Click to show internal directories.
Click to hide internal directories.