listenaddress

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// ListenAddressType is the port type for the port
	ListenAddressType Resolver `yaml:"type" validate:"nonzero"`

	// 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.
	EnvVarListenPort *string `yaml:"envVarListenPort"`

	// EnvVarListenHost specifies the environment variable name for the listen address hostname.
	EnvVarListenHost *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