config

package
Version: v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 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"`
	ContentType          string `mapstructure:"contentType"`
}

func (*KubernetesApiConfiguration) ClientContentType added in v1.1.0

func (c *KubernetesApiConfiguration) ClientContentType() string

func (*KubernetesApiConfiguration) KubernetesConfigFilePath

func (c *KubernetesApiConfiguration) KubernetesConfigFilePath() *string

func (*KubernetesApiConfiguration) Verify added in v1.1.0

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

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

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 added in v1.0.1

func WithConfigType(configType string) ViperOption

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

func WithDefaultConfigName

func WithDefaultConfigName() ViperOption

func WithFileSystem added in v1.0.1

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