config

package
v0.0.0-...-abbbc68 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2016 License: GPL-3.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationReader

type ConfigurationReader interface {
	// GetListeningPort returns the port the application should start listening on.
	GetListeningPort() (int, error)

	// GetOverrideHostname returns the overridden hostname to be used by the service discovery. If provided, the IP addresses or hostname
	// provided by the service must be overridden by this parameter.
	// This parameter is meant to be used in development environment.
	GetOverrideHostname() (string, error)
}

ConfigurationReader defines the interface that provides access to all configurations parameters required by the service.

type ConsulConfigurationReader

type ConsulConfigurationReader struct {
	ConsulAddress              string
	ConsulScheme               string
	ListeningPortToOverride    int
	OverrideHostnameToOverride string
}

ConsulConfigurationReader implements ConfigurationReader using Consul to provide access to all configurations parameters required by the service.

func (ConsulConfigurationReader) GetListeningPort

func (consul ConsulConfigurationReader) GetListeningPort() (int, error)

GetListeningPort returns the port the application should start listening on. Returns either the listening port or error if something goes wrong.

func (ConsulConfigurationReader) GetOverrideHostname

func (consul ConsulConfigurationReader) GetOverrideHostname() (string, error)

GetOverrideHostname returns the overridden hostname to be used by the service discovery. If provided, the IP addresses or hostname provided by the service must be overridden by this parameter. This parameter is meant to be used in development environment.

Jump to

Keyboard shortcuts

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