config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const NameRegexp = "^[a-zA-Z0-9\\-]{1,32}$"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version        int                   `yaml:"Version"`        // must be 0
	MqttClients    []*MqttClientConfig   `yaml:"MqttClient"`     // mandatory: at least 1 must be defined
	InfluxClients  []*InfluxClientConfig `yaml:"InfluxClients"`  // mandatory: at least 1 must be defined
	Converters     []*ConverterConfig    `yaml:"Converters"`     // mandatory: at least 1 must be defined
	HttpServer     HttpServerConfig      `yaml:"HttpServer"`     // optional: default Disabled
	Statistics     StatisticsConfig      `yaml:"Statistics"`     // optional: default Disabled
	LogConfig      bool                  `yaml:"LogConfig"`      // optional: default False
	LogWorkerStart bool                  `yaml:"LogWorkerStart"` // optional: default False
	LogMqttDebug   bool                  `yaml:"LogMqttDebug"`   // optional: default False
}

func ReadConfig

func ReadConfig(yamlStr []byte) (config Config, err []error)

func ReadConfigFile

func ReadConfigFile(exe, source string) (config Config, err []error)

func (Config) MarshalYAML

func (c Config) MarshalYAML() (interface{}, error)

func (Config) PrintConfig

func (c Config) PrintConfig() (err error)

type ConverterConfig

type ConverterConfig struct {
	// contains filtered or unexported fields
}

func (ConverterConfig) Implementation

func (c ConverterConfig) Implementation() string

func (ConverterConfig) InfluxClients

func (c ConverterConfig) InfluxClients() []string

func (ConverterConfig) LogHandleOnce

func (c ConverterConfig) LogHandleOnce() bool

func (ConverterConfig) MqttClients

func (c ConverterConfig) MqttClients() []string

func (ConverterConfig) MqttTopics

func (c ConverterConfig) MqttTopics() []string

func (ConverterConfig) Name

func (c ConverterConfig) Name() string

func (ConverterConfig) TargetMeasurement

func (c ConverterConfig) TargetMeasurement() string

type HttpServerConfig

type HttpServerConfig struct {
	// contains filtered or unexported fields
}

func (HttpServerConfig) Bind

func (c HttpServerConfig) Bind() string

func (HttpServerConfig) Enabled

func (c HttpServerConfig) Enabled() bool

func (HttpServerConfig) LogRequests

func (c HttpServerConfig) LogRequests() bool

func (HttpServerConfig) Port

func (c HttpServerConfig) Port() int

type InfluxClientConfig

type InfluxClientConfig struct {
	// contains filtered or unexported fields
}

func (InfluxClientConfig) Address

func (c InfluxClientConfig) Address() string

func (InfluxClientConfig) Database

func (c InfluxClientConfig) Database() string

func (InfluxClientConfig) LogLineProtocol

func (c InfluxClientConfig) LogLineProtocol() bool

func (InfluxClientConfig) Name

func (c InfluxClientConfig) Name() string

func (InfluxClientConfig) Password

func (c InfluxClientConfig) Password() string

func (InfluxClientConfig) TimePrecision

func (c InfluxClientConfig) TimePrecision() time.Duration

func (InfluxClientConfig) User

func (c InfluxClientConfig) User() string

func (InfluxClientConfig) WriteInterval

func (c InfluxClientConfig) WriteInterval() time.Duration

type MqttClientConfig

type MqttClientConfig struct {
	// contains filtered or unexported fields
}

func (MqttClientConfig) AvailabilityTopic

func (c MqttClientConfig) AvailabilityTopic() string

func (MqttClientConfig) Broker

func (c MqttClientConfig) Broker() string

func (MqttClientConfig) ClientId

func (c MqttClientConfig) ClientId() string

func (MqttClientConfig) LogMessages

func (c MqttClientConfig) LogMessages() bool

func (MqttClientConfig) Name

func (c MqttClientConfig) Name() string

func (MqttClientConfig) Password

func (c MqttClientConfig) Password() string

func (MqttClientConfig) Qos

func (c MqttClientConfig) Qos() byte

func (MqttClientConfig) TopicPrefix

func (c MqttClientConfig) TopicPrefix() string

func (MqttClientConfig) User

func (c MqttClientConfig) User() string

type StatisticsConfig

type StatisticsConfig struct {
	// contains filtered or unexported fields
}

func (StatisticsConfig) Enabled

func (c StatisticsConfig) Enabled() bool

func (StatisticsConfig) HistoryMaxAge

func (c StatisticsConfig) HistoryMaxAge() time.Duration

func (StatisticsConfig) HistoryResolution

func (c StatisticsConfig) HistoryResolution() time.Duration

Jump to

Keyboard shortcuts

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