ginhttp

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 NewServer

func NewServer() *Server

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 (s *Server) GetGinEngine() *gin.Engine

func (*Server) GetServer

func (s *Server) GetServer() *http.Server

func (*Server) InitConfig

func (s *Server) InitConfig() bootstrap.BeforeServerStartFunc

func (*Server) Serve

func (s *Server) Serve() error

Serve serve http request

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL