config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListeningAddress string `mapstructure:"LISTENING_ADDRESS"`
	BrokerAddress    string `mapstructure:"BROKER_ADDRESS"`
	BrokerPort       int    `mapstructure:"BROKER_PORT"`
	BrokerUser       string `mapstructure:"BROKER_USER"`
	BrokerPassword   string `mapstructure:"BROKER_PASSWORD"`
	BrokerTopic      string `mapstructure:"BROKER_TOPIC"`
	ClientID         string `mapstructure:"CLIENT_ID"`
	Frequency        int    `mapstructure:"FREQ"`
}

Config stores all configuration of the application. The values are read by viper from a config file or environment variable.

func LoadConfig

func LoadConfig(path string) (config Config, err error)

LoadConfig reads configuration from file environment variables.

type DeviceConfig

type DeviceConfig []struct {
	GwID string `json:"gwId"`
	Key  string `json:"key"`
	Type string `json:"type"`
	Name string `json:"name"`
}

func LoadDevices

func LoadDevices(path string) (devices DeviceConfig, err error)

Jump to

Keyboard shortcuts

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