config

package
v0.1.95 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 10 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 separated values data
	CSVType = "csv"
	// JSONType is used to identify the data as json messages
	JSONType = "json"

	CanBusType = "canbus"

	SignalKType = "signalk"

	HttpType = "http"

	ParityMap string = "NOE" // None, Odd, Even
)
View Source
const (
	ProtocolOptionNmeaParse                = "nmeaparse"
	ProtocolOptionModbusSkipFaultDetection = "skipfaultdetection"
)

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 CSVMapperConfig added in v0.1.43

type CSVMapperConfig struct {
	MapperConfig `mapstructure:",squash"`
	Separator    string `mapstructure:"separator"`
	SplitLines   bool   `mapstructure:"splitLines"`
}

func NewCSVMapperConfig added in v0.1.43

func NewCSVMapperConfig(configFilePath string) CSVMapperConfig

type CSVMappingConfig added in v0.1.16

type CSVMappingConfig struct {
	MappingConfig `mapstructure:",squash"`
	BeginsWith    string `mapstructure:"beginsWith"`
	Regex         string `mapstructure:"regex"`
	ReplaceWith   string `mapstructure:"replaceWith"`
}

func NewCSVMappingConfig added in v0.1.16

func NewCSVMappingConfig(configFilePath string) []CSVMappingConfig

type CanBusMapperConfig added in v0.1.26

type CanBusMapperConfig struct {
	MapperConfig `mapstructure:",squash"`
	DbcFile      string `mapstructure:"dbcFile"`
}

func NewCanBusMapperConfig added in v0.1.26

func NewCanBusMapperConfig(configFilePath string) CanBusMapperConfig

type CanBusMappingConfig added in v0.1.26

type CanBusMappingConfig struct {
	MappingConfig `mapstructure:",squash"`
	Name          string `mapstructure:"name"`
	Origin        string `mapstructure:"origin"`
}

func NewCanBusMappingConfig added in v0.1.26

func NewCanBusMappingConfig(configFilePath string) []CanBusMappingConfig

type ConnectorConfig added in v0.1.49

type ConnectorConfig 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 NewConnectorConfig added in v0.1.49

func NewConnectorConfig(configFilePath string) *ConnectorConfig

type EventConfig added in v0.1.38

type EventConfig struct {
	Expression string `mapstructure:"expression"`
}

func NewEventConfig added in v0.1.38

func NewEventConfig(configFilePath string) *EventConfig

type ExpressionMappingConfig added in v0.1.80

type ExpressionMappingConfig struct {
	MappingConfig `mapstructure:",squash"`
	SourcePaths   []string      `mapstructure:"sourcePaths"`
	RetentionTime time.Duration `mapstructure:"retentionTime"`
	Overwrite     bool          `mapstructure:"overwrite"`
}

func NewExpressionMappingConfig added in v0.1.80

func NewExpressionMappingConfig(configFilePath string) []ExpressionMappingConfig

type JSONMappingConfig added in v0.1.16

type JSONMappingConfig struct {
	MappingConfig `mapstructure:",squash"`
}

func NewJSONMappingConfig added in v0.1.16

func NewJSONMappingConfig(configFilePath string) []JSONMappingConfig

type LWEConfig added in v0.1.29

type LWEConfig struct {
	DestinationIdentification string `mapstructure:"destination_identification"`
	SourceIdentification      string `mapstructure:"source_identification"`
	IncludeTimestamp          bool   `mapstructure:"include_timestamp"`
	IncludeLineCount          bool   `mapstructure:"include_line_count"`
}

func NewLWEConfig added in v0.1.29

func NewLWEConfig(configFilePath string) *LWEConfig

type MQTTConfig added in v0.1.16

type MQTTConfig struct {
	URLString  string        `mapstructure:"url"`
	Username   string        `mapstructure:"username"`
	Password   string        `mapstructure:"password"`
	Interval   time.Duration `mapstructure:"interval"`    // interval to flush the cache in seconds, ignored for reader
	BufferSize int           `mapstructure:"buffer_size"` // 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"`
	ProtocolOptions map[string]string `mapstructure:"protocolOptions"`
}

func NewMapperConfig

func NewMapperConfig(configFilePath string) MapperConfig

type MappingConfig added in v0.1.26

type MappingConfig struct {
	Expression            string                 `mapstructure:"expression"`
	ExpressionEnvironment map[string]interface{} `mapstructure:"expressionEnvironment"`
	CompiledExpression    *vm.Program
	Path                  string `mapstructure:"path"`
}

type ModbusMappingsConfig added in v0.1.16

type ModbusMappingsConfig struct {
	MappingConfig         `mapstructure:",squash"`
	protocol.ModbusHeader `mapstructure:",squash"`
}

func NewModbusMappingsConfig added in v0.1.16

func NewModbusMappingsConfig(configFilePath string) []ModbusMappingsConfig

type PostgresqlConfig

type PostgresqlConfig struct {
	URLString          string        `mapstructure:"url"`
	BatchFlushLength   int           `mapstructure:"batch_flush_length"`
	BatchFlushInterval time.Duration `mapstructure:"batch_flush_interval"`
	BufferSize         int           `mapstructure:"buffer_size"`       // size of the buffer for incoming messages
	NumberOfWorkers    int           `mapstructure:"number_of_workers"` // number of workers to handle the incoming messages
	Timeout            time.Duration `mapstructure:"timeout"`
}

func NewPostgresqlConfig

func NewPostgresqlConfig(configFilePath string) *PostgresqlConfig

type RateLimitFilterConfig added in v0.1.80

type RateLimitFilterConfig struct {
	Ratelimits      []RateLimitsConfig `mapstructure:"rateLimits"`
	DefaultInterval time.Duration      `mapstructure:"defaultInterval"`
}

func NewRateLimitConfig added in v0.1.41

func NewRateLimitConfig(configFilePath string) *RateLimitFilterConfig

type RateLimitsConfig added in v0.1.41

type RateLimitsConfig struct {
	Path     string        `mapstructure:"path"`
	Interval time.Duration `mapstructure:"interval"`
}

type RegisterGroupConfig

type RegisterGroupConfig struct {
	protocol.ModbusHeader `mapstructure:",squash"`
	PollingInterval       time.Duration `mapstructure:"pollingInterval"`
}

func NewRegisterGroupsConfig

func NewRegisterGroupsConfig(configFilePath string) []RegisterGroupConfig

func (*RegisterGroupConfig) ExtractModbusHeader added in v0.1.86

func (rgc *RegisterGroupConfig) ExtractModbusHeader() *protocol.ModbusHeader

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:"database"`
	BigCacheConfig   *BigCacheConfig   `mapstructure:"cache"`
}

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

type TestDataConfig added in v0.1.79

type TestDataConfig struct {
	Context string          `mapstructure:"context"`
	Delay   time.Duration   `mapstructure:"delay"`
	Paths   []MappingConfig `mapstructure:"paths"`
}

func NewTestDataConfig added in v0.1.79

func NewTestDataConfig(configFilePath string) *TestDataConfig

type TransferConfig added in v0.1.28

type TransferConfig struct {
	PostgresqlConfig          PostgresqlConfig `mapstructure:"database"`
	MQTTConfig                MQTTConfig       `mapstructure:"mqtt"`
	Origin                    string           `mapstructure:"origin"`
	SleepBetweenCountRequests time.Duration    `mapstructure:"sleep_between_count_requests"`
	SleepBetweenDataRequests  time.Duration    `mapstructure:"sleep_between_data_requests"`
	SleepBetweenRespondDeltas time.Duration    `mapstructure:"sleep_between_respond_deltas"`
	NumberOfRequestWorkers    int              `mapstructure:"number_of_request_workers"`
	MaxPeriodsToRequest       int              `mapstructure:"max_periods_to_request"`
}

func NewTransferConfig added in v0.1.29

func NewTransferConfig(configFilePath string) *TransferConfig

type UrlGroupConfig added in v0.1.43

type UrlGroupConfig struct {
	Url             string        `mapstructure:"url"`
	PollingInterval time.Duration `mapstructure:"pollingInterval"`
}

func NewUrlGroupsConfig added in v0.1.43

func NewUrlGroupsConfig(configFilePath string) []UrlGroupConfig

Jump to

Keyboard shortcuts

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