config

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 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"`
	BearerToken string        `yaml:"bearer_token"`
	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"`
	AdditionalTags  map[string]string `yaml:"additional_tags,omitempty"`
}

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"`
	BrokerUrl         string `yaml:"broker_url"`
	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"`
	LWTTopic          string `yaml:"lwt_topic"`
	LWTOnlinePayload  string `yaml:"lwt_online_payload"`
	LWTOfflinePayload string `yaml:"lwt_offline_payload"`
}

type MQTTPublisher

type MQTTPublisher struct {
	Enabled                      *bool         `yaml:"enabled,omitempty"`
	MinimumInterval              time.Duration `yaml:"minimum_interval,omitempty"`
	BrokerUrl                    string        `yaml:"broker_url"`
	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"`
	LWTTopic                     string        `yaml:"lwt_topic"`
	LWTOnlinePayload             string        `yaml:"lwt_online_payload"`
	LWTOfflinePayload            string        `yaml:"lwt_offline_payload"`
}

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