server

package
v1.11.0-RC1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addresses

type Addresses struct {
	HTTP string
}

Addresses encapsulates all of the addresses we bind to for various network services. Everything is optional and defaults to BindAddr.

type Config

type Config struct {
	// Region is the region this server is supposed to deal in.
	// Defaults to global.
	Region string

	// LogLevel is the level of the logs to putout
	LogLevel string

	// BindAddr is the address on which server services will
	// be bound. If not specified, this defaults to 127.0.0.1.
	BindAddr string

	// Port is used to control the network ports we bind to.
	Port *int

	// Addresses is used to override the network addresses we bind to.
	//
	// Use normalizedAddrs if you need the host+port to bind to.
	Addresses *Addresses

	// NormalizedAddr is set to the Address+Port by normalizeAddrs()
	NormalizedAddrs *Addresses

	// LeaveOnTerm is used to gracefully leave on the terminate signal
	LeaveOnTerm bool

	// HTTPAPIResponseHeaders allows users to configure the http agent to
	// set arbitrary headers on API responses
	HTTPAPIResponseHeaders map[string]string
}

Config is the configuration for server.

func DefaultServerConfig

func DefaultServerConfig() *Config

DefaultServerConfig is a the baseline configuration for server

func (*Config) Listener

func (c *Config) Listener(proto, addr string, port int) (net.Listener, error)

Listener can be used to get a new listener using a custom bind address. If the bind provided address is empty, the BindAddr is used instead.

func (*Config) NormalizeAddrs

func (c *Config) NormalizeAddrs() error

NormalizeAddrs normalizes Addresses to always be initialized and have sane defaults.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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