config

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 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"
	// JSONType is used to identify the data as json messages
	JSONType = "json"

	ParityMap string = "NOE" // None, Odd, Even
)
View Source
const (
	Coils = iota + 1
	DiscreteInputs
	HoldingRegisters
	InputRegisters
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BigCacheConfig added in v0.1.18

type BigCacheConfig 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
}

func NewBigCacheConfig added in v0.1.18

func NewBigCacheConfig(configFilePath string) *BigCacheConfig

type CSVMappingConfig added in v0.1.16

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

func NewCSVMappingConfig added in v0.1.16

func NewCSVMappingConfig(configFilePath string) []CSVMappingConfig

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   `mapstructure:"protocol"`
}

func NewCollectorConfig

func NewCollectorConfig(configFilePath string) *CollectorConfig

type JSONMappingConfig added in v0.1.16

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

func NewJSONMappingConfig added in v0.1.16

func NewJSONMappingConfig(configFilePath string) []JSONMappingConfig

type MQTTConfig added in v0.1.16

type MQTTConfig struct {
	URLString        string `mapstructure:"url"`
	Username         string `mapstructure:"username"`
	Password         string `mapstructure:"password"`
	Interval         int    `mapstructure:"interval"`         // interval to flush the cache in seconds, ignored for reader
	HardMaxCacheSize int    `mapstructure:"hardMaxCacheSize"` // maximum size of the cache in MBs, cache will be flushed when size is reached, ignored for reader
}

func NewMQTTConfig added in v0.1.16

func NewMQTTConfig(configFilePath string) *MQTTConfig

type MapperConfig

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

func NewMapperConfig

func NewMapperConfig(configFilePath string) MapperConfig

type ModbusMappingsConfig added in v0.1.16

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

func NewModbusMappingsConfig added in v0.1.16

func NewModbusMappingsConfig(configFilePath string) []ModbusMappingsConfig

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"`
	NumberOfCoilsRegisters uint16        `mapstructure:"numberOfCoilsOrRegisters"`
	PollingInterval        time.Duration `mapstructure:"pollingInterval"`
}

func NewRegisterGroupsConfig

func NewRegisterGroupsConfig(configFilePath string) []RegisterGroupConfig

type SignalKConfig added in v0.1.18

type SignalKConfig struct {
	URLString        string            `mapstructure:"url"`
	URL              *url.URL          `mapstructure:"_"`
	Version          string            `mapstructure:"_"`
	SelfContext      string            `mapstructure:"self_context"`
	PostgresqlConfig *PostgresqlConfig `mapstructure:"_"`
	BigCacheConfig   *BigCacheConfig   `mapstructure:"_"`
}

func NewSignalKConfig added in v0.1.18

func NewSignalKConfig(configFilePath string) *SignalKConfig

func (*SignalKConfig) WithVersion added in v0.1.18

func (c *SignalKConfig) WithVersion(version string) *SignalKConfig

Jump to

Keyboard shortcuts

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