Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Recovery ¶
func Recovery() gin.HandlerFunc
Recovery returns a middleware that recovers from any panics and writes a 500 if there was one.
Types ¶
type Server ¶
func DefaultServer ¶
func DefaultServer(conf *ServerConfig) *Server
DefaultServer returns an Engine instance with the Recovery and Logger middleware already attached.
func NewServer ¶
func NewServer(conf *ServerConfig) *Server
NewServer returns a new blank Engine instance without any middleware attached.
func (*Server) RunServer ¶
RunServer will serve and start listening HTTP requests by given server and listener. Note: this method will block the calling goroutine indefinitely unless an error happens.
type ServerConfig ¶
type ServerConfig struct { Network string `dsn:"network"` Addr string `dsn:"address"` Timeout time.Duration `dsn:"query.timeout"` ReadTimeout time.Duration `dsn:"query.readTimeout"` WriteTimeout time.Duration `dsn:"query.writeTimeout"` }
ServerConfig is the bm server config model
Click to show internal directories.
Click to hide internal directories.