config

package
v2.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MqttDefaultBrokerEnv = "NAMESPACE_BROKER_PORT"

Variables

This section is empty.

Functions

func ReadConfig

func ReadConfig(envVarPrefix string, configInstance interface{}, options ...ViperOption) error

Types

type KubernetesApiConfiguration

type KubernetesApiConfiguration struct {
	InCluster            bool   `mapstructure:"inCluster"`
	KubernetesConfigFile string `mapstructure:"kubernetesConfigFile"`
}

func (*KubernetesApiConfiguration) Verify

func (c *KubernetesApiConfiguration) Verify() error

type MqttClientConfig

type MqttClientConfig struct {
	Broker              string              `mapstructure:"broker"`
	ClientId            string              `mapstructure:"clientId"`
	MqttTlsClientConfig MqttTlsClientConfig `mapstructure:"mqttTlsClientConfig"`
}

func (*MqttClientConfig) Verify

func (c *MqttClientConfig) Verify() error

TODO log entries here are not context-scoped, so will not be transferred to any client

type MqttTlsClientConfig

type MqttTlsClientConfig struct {
	ServerCaFile      string `mapstructure:"serverCaFile"`
	ClientCertFile    string `mapstructure:"clientCertFile"`
	ClientCertKeyFile string `mapstructure:"clientCertKeyFile"`
}

func (*MqttTlsClientConfig) Verify

func (c *MqttTlsClientConfig) Verify() error

TODO log entries here are not context-scoped, so will not be transferred to any client

type ViperOption

type ViperOption func(v *viper.Viper)

func WithConfigFile

func WithConfigFile(configFile string) ViperOption

/ ConfigFile (complete config file name i.e. "some-config-file.json" => some-config-file.json)

func WithConfigName

func WithConfigName(configName string) ViperOption

/ ConfigName (config file base name i.e. "config" => config.*)

func WithConfigPath

func WithConfigPath(path string) ViperOption

/ PATH (directory which get searched for config files)

func WithConfigType

func WithConfigType(configType string) ViperOption

/ ConfigType (config file extension i.e. "yaml" => [ConfigName].yaml)

func WithDefaultConfigName

func WithDefaultConfigName() ViperOption

func WithFileSystem

func WithFileSystem(fs afero.Fs) ViperOption

/ FileSystem (sets the used filesystem to read config file from)

func WithLocalPath

func WithLocalPath() ViperOption

Jump to

Keyboard shortcuts

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