listenaddress

package
v0.15.7 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package listenaddress provides a configuration struct for resolving a listen address from YAML.

Deprecation notice: The environment resolution behavior of this class has largely been superseded by config environment interpolation in go.uber.org/config (see config/README.md for details). Instead of:

   listenAddress:
     type: environment
     envVarListenPort: MY_PORT_VAR

one can do:

   listenAddress:
     value: 0.0.0.0:${MY_PORT_VAR}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// DeprecatedListenAddressType is the port type for the port
	// DEPRECATED: use config interpolation with `value` (config/README.md)
	DeprecatedListenAddressType Resolver `yaml:"type"`

	// Value is the config specified listen address if using config port type.
	Value *string `yaml:"value"`

	// EnvVarListenPort specifies the environment variable name for the listen address port.
	// DEPRECATED: use config interpolation with `value` (config/README.md)
	DeprecatedEnvVarListenPort *string `yaml:"envVarListenPort"`

	// DeprecatedEnvVarListenHost specifies the environment variable name for the listen address hostname.
	// DEPRECATED: use config interpolation with `value` (config/README.md)
	DeprecatedEnvVarListenHost *string `yaml:"envVarListenHost"`
}

Configuration is the configuration for resolving a listen address.

func (Configuration) Resolve

func (c Configuration) Resolve() (string, error)

Resolve returns the resolved listen address given the configuration.

type Resolver

type Resolver string

Resolver is a type of port resolver

const (
	// ConfigResolver resolves port using a value provided in config
	ConfigResolver Resolver = "config"
	// EnvironmentResolver resolves port using an environment variable
	// of which the name is provided in config
	EnvironmentResolver Resolver = "environment"
)

Jump to

Keyboard shortcuts

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