config

package
v0.0.0-...-1ed4819 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// EnvConfigPrefix is used when configs should be read from environment variables.
	EnvConfigPrefix = "$env"
)

Variables

This section is empty.

Functions

func ClearLogConfigInstance

func ClearLogConfigInstance()

ClearLogConfigInstance removes the existing configuration. Then the log configuration can be re-initialized.

func GetLogConfigPath

func GetLogConfigPath() (string, error)

GetLogConfigPath returns the file location of the log-config path

func ResolveConfigEnvValues

func ResolveConfigEnvValues(v reflect.Value, previousTag string, resolveEnvTag bool)

ResolveConfigEnvValues looks for the string type config values which should be read from environment variables and replace the respective config values from environment variable. v - relect.Value of the root level struct previousTag - the starting Tag corresponding to the root level struct resolveEnvTag - true if $env{} annotation needs to be resolved at adapter level

func ResolveEnvValue

func ResolveEnvValue(value string) string

ResolveEnvValue replace the respective config values from environment variable.

func UpdateLoggers

func UpdateLoggers()

UpdateLoggers initializes the logger package references

Types

type Config

type Config struct {
	CommonController commoncontroller
}

Config represents the adapter configuration. It is created directly from the configuration toml file.

func ReadConfigs

func ReadConfigs() *Config

ReadConfigs implements adapter configuration read operation. The read operation will happen only once, hence the consistancy is ensured.

If the "APK_HOME" variable is set, the configuration file location would be picked relative to the variable's value ("/conf/config.toml"). otherwise, the "APK_HOME" variable would be set to the directory from where the executable is called from.

Returns the configuration object that is initialized with default values. Changes to the default configuration object is achieved through the configuration file.

type Metrics

type Metrics struct {
	Enabled bool
	Type    string
	Port    int32
}

Metrics defines the configuration for metrics collection.

Jump to

Keyboard shortcuts

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