http

package
v2.15.11 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Host and port to handle as http server.
	Address string `mapstructure:"address"`

	// AccessLogs turn on/off, logged at Info log level, default: false
	AccessLogs bool `mapstructure:"access_logs"`

	// InternalErrorCode used to override default 500 (InternalServerError) http code
	InternalErrorCode uint64 `mapstructure:"internal_error_code"`

	// MaxRequestSize specified max size for payload body in megabytes, set 0 to unlimited.
	MaxRequestSize uint64 `mapstructure:"max_request_size"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewHTTPServer

func NewHTTPServer(handler http.Handler, cfg *Config, errLog *log.Logger, log *zap.Logger, enableH2C bool, redirect bool, redirectPort int) *Server

func (*Server) GetServer

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

func (*Server) Start

func (s *Server) Start(mdwr map[string]middleware.Middleware, order []string) error

Start is a blocking function

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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