web

package
v0.0.0-...-f0cd508 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ServersModule of web base structs
	ServersModule = module.Module{
		{Constructor: newProfileServer},
		{Constructor: newMetricServer},
		{Constructor: NewAPIServer},
		{Constructor: NewMultiServer},
	}
)

Functions

func NewHTTPServer

func NewHTTPServer(conf Config, h http.Handler, l *zap.Logger) (web.ServerResult, error)

NewHTTPServer creates http-server that will be embedded into multi-server

func NewMultiServer

func NewMultiServer(p MultiServerParams) (web.Service, error)

NewMultiServer returns new multi servers group

Types

type APIParams

type APIParams struct {
	dig.In

	Config  Config `optional:"true"`
	Logger  *zap.Logger
	Handler http.Handler `optional:"true"`
}

APIParams struct

type Config

type Config struct {
	Address        string
	Network        string
	MaxHeaderBytes int
	Disabled       bool
	SkipErrors     bool

	ShutdownTimeout   time.Duration
	ReadTimeout       time.Duration
	ReadHeaderTimeout time.Duration
	WriteTimeout      time.Duration
	IdleTimeout       time.Duration
}

type MetricConfig

type MetricConfig Config

type MultiServerParams

type MultiServerParams struct {
	dig.In

	Logger  *zap.Logger
	Servers []web.Service `group:"services"`
}

MultiServerParams struct

type PprofConfig

type PprofConfig Config

type ServerResult

type ServerResult = web.ServerResult

func NewAPIServer

func NewAPIServer(p APIParams) (ServerResult, error)

NewAPIServer creates api server by http.Handler from DI container

Jump to

Keyboard shortcuts

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