Documentation ¶
Index ¶
- Constants
- func Execute()
- type AdapterConfig
- type Config
- type DeviceConfig
- type DeviceConfigHandler
- func (conf *DeviceConfigHandler) ConnectionManager(connSpec string, rtu bool, baudrate int, comset string, timeout time.Duration) *meters.Manager
- func (conf *DeviceConfigHandler) CreateDevice(devConf DeviceConfig)
- func (conf *DeviceConfigHandler) CreateDeviceFromSpec(deviceDef string, timeout time.Duration)
- type InfluxConfig
- type MqttConfig
Constants ¶
View Source
const DefaultTimeout = 300 * time.Millisecond
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdapterConfig ¶
AdapterConfig describes device communication parameters
type Config ¶
type Config struct { API string Rate time.Duration Mqtt MqttConfig Influx InfluxConfig Adapters []AdapterConfig Devices []DeviceConfig Other map[string]interface{} `mapstructure:",remain"` }
Config describes the entire configuration
type DeviceConfig ¶
DeviceConfig describes a single device's configuration
type DeviceConfigHandler ¶
DeviceConfigHandler creates map of meter managers from given configuration
func NewDeviceConfigHandler ¶
func NewDeviceConfigHandler() *DeviceConfigHandler
NewDeviceConfigHandler creates a configuration handler
func (*DeviceConfigHandler) ConnectionManager ¶
func (conf *DeviceConfigHandler) ConnectionManager(connSpec string, rtu bool, baudrate int, comset string, timeout time.Duration) *meters.Manager
ConnectionManager returns connection manager from cache or creates new connection wrapped by manager
func (*DeviceConfigHandler) CreateDevice ¶
func (conf *DeviceConfigHandler) CreateDevice(devConf DeviceConfig)
CreateDevice creates new device and adds it to the connection manager
func (*DeviceConfigHandler) CreateDeviceFromSpec ¶
func (conf *DeviceConfigHandler) CreateDeviceFromSpec(deviceDef string, timeout time.Duration)
CreateDeviceFromSpec creates new device from specification string and adds it to the connection manager
Click to show internal directories.
Click to hide internal directories.