server

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const TLSProxyOption = "https_dev_proxy"

Variables

This section is empty.

Functions

func NewTLSProxy

func NewTLSProxy(addr, port string, logger logrus.FieldLogger, settings *config.Settings) (*http.Server, error)

Types

type ErrorWrapper

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

ErrorWrapper logs incoming Write bytes with the context filled logrus.FieldLogger.

func (*ErrorWrapper) Write

func (e *ErrorWrapper) Write(p []byte) (n int, err error)

type HTTPServer

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

HTTPServer represents a configured HTTP server.

func New

func New(cmdCtx, evalCtx context.Context, log logrus.FieldLogger, settings *config.Settings,
	timings *runtime.HTTPTimings, p runtime.Port, hosts runtime.Hosts) *HTTPServer

New creates a configured HTTP server.

func NewServerList

func NewServerList(cmdCtx, evalCtx context.Context, log logrus.FieldLogger, settings *config.Settings,
	timings *runtime.HTTPTimings, srvConf runtime.ServerConfiguration) ([]*HTTPServer, func())

NewServerList creates a list of all configured HTTP server.

func (*HTTPServer) Addr

func (s *HTTPServer) Addr() string

Addr returns the listener address.

func (*HTTPServer) Close

func (s *HTTPServer) Close() error

Close closes the listener

func (*HTTPServer) Listen

func (s *HTTPServer) Listen() error

Listen initiates the configured http handler and start listing on given port.

func (*HTTPServer) ServeHTTP

func (s *HTTPServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type ListenPort

type ListenPort string

func (ListenPort) Port

func (lp ListenPort) Port() runtime.Port

type Mux

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

Mux is a http request router and dispatches requests to their corresponding http handlers.

func NewMux

func NewMux(options *runtime.MuxOptions) *Mux

func (*Mux) FindHandler

func (m *Mux) FindHandler(req *http.Request) http.Handler

func (*Mux) MustAddRoute

func (m *Mux) MustAddRoute(method, path string, handler http.Handler) *Mux

type Ports

type Ports []string

func (Ports) Contains

func (tp Ports) Contains(needle string) bool

type TLSDevPorts

type TLSDevPorts map[ListenPort]Ports

func (TLSDevPorts) Add

func (tdp TLSDevPorts) Add(pair string) error

func (TLSDevPorts) Get

func (tdp TLSDevPorts) Get(p string) []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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