configuration

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigRegistryStemCore = "edgex/core/"
	ConfigMajorVersion     = "1.0/"
	WritableKey            = "/Writable"
)

Variables

This section is empty.

Functions

func ListenForChanges

func ListenForChanges(
	ctx context.Context,
	wg *sync.WaitGroup,
	config interfaces.Configuration,
	lc logger.LoggingClient,
	registryClient registry.Client)

ListenForChanges leverages the registry client's WatchForChanges() method to receive changes to and update the service's configuration struct's writable substruct. It's assumed the log level is universally part of the writable struct and this function explicitly updates the loggingClient's log level when new configuration changes are received.

func LoadFromFile

func LoadFromFile(configDir, profileDir, configFileName string, config interfaces.Configuration) error

LoadFromFile attempts to read and unmarshal toml-based configuration into a configuration struct.

func OverrideFromEnvironment

func OverrideFromEnvironment(
	registry config.RegistryInfo,
	startup config.StartupInfo) (config.RegistryInfo, config.StartupInfo)

OverrideFromEnvironment overrides the registryInfo values from an environment variable value (if it exists).

func UpdateFromRegistry

func UpdateFromRegistry(
	ctx context.Context,
	startupTimer startup.Timer,
	config interfaces.Configuration,
	lc logger.LoggingClient,
	serviceKey string) (registry.Client, error)

UpdateFromRegistry connects to the registry, registers the service, gets configuration, and updates the service's configuration struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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