Documentation ¶
Index ¶
- type Server
- func (s *Server) AddAfterServerStopFunc(fns ...bootstrap.AfterServerStopFunc)
- func (s *Server) AddBeforeServerStartFunc(fns ...bootstrap.BeforeServerStartFunc)
- func (s *Server) AddServerAfterFunc(fns ...bootstrap.AfterServerStopFunc)
- func (s *Server) AddServerBeforeFunc(fns ...bootstrap.BeforeServerStartFunc)
- func (s *Server) GetGinEngine() *gin.Engine
- func (s *Server) GetServer() *http.Server
- func (s *Server) InitConfig() bootstrap.BeforeServerStartFunc
- func (s *Server) Serve() error
- type ServerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AddAfterServerStopFunc ¶
func (s *Server) AddAfterServerStopFunc(fns ...bootstrap.AfterServerStopFunc)
func (*Server) AddBeforeServerStartFunc ¶
func (s *Server) AddBeforeServerStartFunc(fns ...bootstrap.BeforeServerStartFunc)
func (*Server) AddServerAfterFunc ¶
func (s *Server) AddServerAfterFunc(fns ...bootstrap.AfterServerStopFunc)
func (*Server) AddServerBeforeFunc ¶
func (s *Server) AddServerBeforeFunc(fns ...bootstrap.BeforeServerStartFunc)
保留兼容
func (*Server) GetGinEngine ¶
func (*Server) InitConfig ¶
func (s *Server) InitConfig() bootstrap.BeforeServerStartFunc
type ServerOptions ¶
type ServerOptions struct { // run mode 可选debug/release Mode string `ini:"mode"` // TCP address to listen on, ":http" if empty Addr string `ini:"addr"` //grace mode 可选graceful/oversea 为空不使用 Grace bool `ini:"grace"` // ReadTimeout is the maximum duration for reading the entire // request, including the body. // // Because ReadTimeout does not let Handlers make per-request // decisions on each request body's acceptable deadline or // upload rate, most users will prefer to use // ReadHeaderTimeout. It is valid to use them both. ReadTimeout time.Duration `ini:"readTimeout"` // WriteTimeout is the maximum duration before timing out // writes of the response. It is reset whenever a new // request's header is read. Like ReadTimeout, it does not // let Handlers make decisions on a per-request basis. WriteTimeout time.Duration `ini:"writeTimeout"` // IdleTimeout is the maximum amount of time to wait for the // next request when keep-alives are enabled. If IdleTimeout // is zero, the value of ReadTimeout is used. If both are // zero, ReadHeaderTimeout is used. IdleTimeout time.Duration `ini:"idelTimeout"` }
ServerOptions http server options
func DefaultOptions ¶
func DefaultOptions() ServerOptions
Click to show internal directories.
Click to hide internal directories.