config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NMEA0183Type is used to identify the data as NMEA 0183 data
	NMEA0183Type = "nmea0183"
	// ModbusType is used to identify the data as Modbus data
	ModbusType = "modbus"
	// CSVType is used to identify the data as comma seperated values data
	CSVType = "csv"

	ParityMap string = "NOE" // None, Odd, Even
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	LifeWindow       int    `mapstructure:"lifeWindow"`       // time after which entry can be evicted, value in seconds
	HardMaxCacheSize int    `mapstructure:"hardMaxCacheSize"` // cache will not allocate more memory than this limit, value in MB
	Heartbeat        uint64 `mapstructure:"heartbeat"`        // every heartbeat all cached values that are in the cache for at least one heartbeat will be send again, value in seconds
}

type CollectorConfig

type CollectorConfig struct {
	Name         string   `mapstructure:"name"`
	URL          *url.URL `mapstructure:"_"`
	URLString    string   `mapstructure:"url"`
	Listen       bool     `mapstructure:"listen"`
	BaudRate     int      `mapstructure:"baudRate"`
	DataBits     int      `mapstructure:"dataBits"`
	StopBits     int      `mapstructure:"stopBits"`
	Parity       int      `mapstructure:"_"`
	ParityString string   `mapstructure:"parity"`
	Protocol     string
}

func NewCollectorConfig

func NewCollectorConfig(configFilePath string) *CollectorConfig

func (*CollectorConfig) WithProtocol

func (c *CollectorConfig) WithProtocol(p string) *CollectorConfig

type CsvMappingConfig

type CsvMappingConfig struct {
	BeginsWith         string `mapstructure:"beginsWith"`
	Expression         string `mapstructure:"expression"`
	CompiledExpression *vm.Program
	Path               string `mapstructure:"path"`
}

func NewCsvMappingConfig

func NewCsvMappingConfig(configFilePath string) []CsvMappingConfig

type MapperConfig

type MapperConfig struct {
	Context string `mapstructure:"context"`
}

func NewMapperConfig

func NewMapperConfig(configFilePath string) MapperConfig

type MqttConfig

type MqttConfig struct {
	URLString string `mapstructure:"url"`
	ClientId  string `mapstructure:"client_id"`
	Username  string `mapstructure:"username"`
	Password  string `mapstructure:"password"`
	Context   string `mapstructure:"context"`
	Interval  int    `mapstructure:"interval"`
}

func NewMqttConfig

func NewMqttConfig(configFilePath string) *MqttConfig

type PostgresqlConfig

type PostgresqlConfig struct {
	URLString string `mapstructure:"url"`
}

func NewPostgresqlConfig

func NewPostgresqlConfig(configFilePath string) *PostgresqlConfig

type RegisterGroupConfig

type RegisterGroupConfig struct {
	Slave             uint8         `mapstructure:"slave"`
	FunctionCode      uint16        `mapstructure:"functionCode"`
	Address           uint16        `mapstructure:"address"`
	NumberOfRegisters uint16        `mapstructure:"numberOfRegisters"`
	PollingInterval   time.Duration `mapstructure:"pollingInterval"`
}

func NewRegisterGroupsConfig

func NewRegisterGroupsConfig(configFilePath string) []RegisterGroupConfig

type RegisterMappingConfig

type RegisterMappingConfig struct {
	Slave              uint8  `mapstructure:"slave"`
	FunctionCode       uint16 `mapstructure:"functionCode"`
	Address            uint16 `mapstructure:"address"`
	NumberOfRegisters  uint16 `mapstructure:"numberOfRegisters"`
	Expression         string `mapstructure:"expression"`
	CompiledExpression *vm.Program
	Path               string `mapstructure:"path"`
}

func NewRegisterMappingsConfig

func NewRegisterMappingsConfig(configFilePath string) []RegisterMappingConfig

Jump to

Keyboard shortcuts

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