http

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InterfaceFieldName field name in configuration file or ENV name for value of HttpConfig.Interface
	InterfaceFieldName = "server.http.interface"

	// PortFieldName field name in configuration file or ENV name for value of HttpConfig.Port
	PortFieldName = "server.http.port"

	ShutdownTimeoutFieldName = "server.http.timeout.shutdown"

	// InterfaceDefault address for listen on default
	InterfaceDefault string = "0.0.0.0"

	// PortDefault port for listen on default
	PortDefault uint = 8080

	ShutdownTimeoutDefault = 30 * time.Second
)

Variables

This section is empty.

Functions

func NewHttp

func NewHttp(config *Config, router chi.Router, informer log.Informer) *http.Server

func WithConfigurator

func WithConfigurator(configurator configurator.Configurator, config *Config, router chi.Router, informer log.Informer) *http.Server

Types

type Config

type Config struct {
	// Interface address for listen
	Interface string

	// Port port for listen
	Port uint

	ShutdownTimeout time.Duration
}

Config setup params for http web server

func NewConfig

func NewConfig() *Config

NewConfig creating and return new structure instance HttpConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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