config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 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"`
	InfluxDB3Publisher *InfluxDB3Publisher `yaml:"influxdb3_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 InfluxDB3Publisher added in v0.2.1

type InfluxDB3Publisher struct {
	Enabled         *bool             `yaml:"enabled,omitempty"`
	MinimumInterval time.Duration     `yaml:"minimum_interval,omitempty"`
	Url             string            `yaml:"url"`
	AuthToken       string            `yaml:"auth_token"`
	Database        string            `yaml:"database"`
	Measurement     string            `yaml:"measurement"`
	AdditionalTags  map[string]string `yaml:"additional_tags,omitempty"`
}

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"`
	PublishRaw                   bool          `yaml:"publish_raw"`
	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"`
	DisableFormats    []string `yaml:"disable_formats"`
	IncludeUnofficial bool     `yaml:"include_unofficial"`
}

type Prometheus

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

Jump to

Keyboard shortcuts

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