config

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: MIT Imports: 5 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 {
	GatewayPolling    *GatewayPolling    `yaml:"gateway_polling,omitempty"`
	MQTTListener      *MQTTListener      `yaml:"mqtt_listener,omitempty"`
	HTTPListener      *HTTPListener      `yaml:"http_listener,omitempty"`
	Processing        *Processing        `yaml:"processing,omitempty"`
	InfluxDBPublisher *InfluxDBPublisher `yaml:"influxdb_publisher,omitempty"`
	Prometheus        *Prometheus        `yaml:"prometheus,omitempty"`
	MQTTPublisher     *MQTTPublisher     `yaml:"mqtt_publisher,omitempty"`
	TagNames          map[string]string  `yaml:"tag_names,omitempty"`
	Logging           Logging            `yaml:"logging"`
	Debug             bool               `yaml:"debug"`
}

func ReadConfig

func ReadConfig(configFile string, strict bool) (Config, error)

type GatewayPolling

type GatewayPolling struct {
	Enabled    *bool         `yaml:"enabled,omitempty"`
	GatewayUrl string        `yaml:"gateway_url"`
	Interval   time.Duration `yaml:"interval"`
}

type HTTPListener added in v0.1.4

type HTTPListener struct {
	Enabled *bool `yaml:"enabled,omitempty"`
	Port    int   `yaml:"port"`
}

type InfluxDBPublisher

type InfluxDBPublisher struct {
	Enabled         *bool         `yaml:"enabled,omitempty"`
	MinimumInterval time.Duration `yaml:"minimum_interval,omitempty"`
	Url             string        `yaml:"url"`
	AuthToken       string        `yaml:"auth_token"`
	Org             string        `yaml:"org"`
	Bucket          string        `yaml:"bucket"`
	Measurement     string        `yaml:"measurement"`
}

type Logging added in v0.1.2

type Logging struct {
	Type       string `yaml:"type"`
	Level      string `yaml:"level"`
	Timestamps *bool  `yaml:"timestamps,omitempty"`
	WithCaller bool   `yaml:"with_caller,omitempty"`
}

type MQTTListener

type MQTTListener struct {
	Enabled       *bool  `yaml:"enabled,omitempty"`
	BrokerAddress string `yaml:"broker_address"`
	BrokerPort    int    `yaml:"broker_port"`
	ClientID      string `yaml:"client_id"`
	Username      string `yaml:"username"`
	Password      string `yaml:"password"`
	TopicPrefix   string `yaml:"topic_prefix"`
}

type MQTTPublisher

type MQTTPublisher struct {
	Enabled                      *bool         `yaml:"enabled,omitempty"`
	MinimumInterval              time.Duration `yaml:"minimum_interval,omitempty"`
	BrokerAddress                string        `yaml:"broker_address"`
	BrokerPort                   int           `yaml:"broker_port"`
	ClientID                     string        `yaml:"client_id"`
	Username                     string        `yaml:"username"`
	Password                     string        `yaml:"password"`
	TopicPrefix                  string        `yaml:"topic_prefix"`
	HomeassistantDiscoveryPrefix string        `yaml:"homeassistant_discovery_prefix,omitempty"`
}

type Processing

type Processing struct {
	ExtendedValues *bool    `yaml:"extended_values,omitempty"`
	FilterMode     string   `yaml:"filter_mode"`
	FilterList     []string `yaml:"filter_list"`
}

type Prometheus

type Prometheus struct {
	Enabled *bool `yaml:"enabled,omitempty"`
	Port    int   `yaml:"port"`
}

Jump to

Keyboard shortcuts

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