natsdevice

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NatsDevice

type NatsDevice struct {
	Name string
	// contains filtered or unexported fields
}

NatsDevice is a device that communicates over nats

func NewNatsDevice

func NewNatsDevice(name string, nc *nats.Conn, ec *nats.EncodedConn, pvs []modbuspv.ModbusPV, logger log.Logger) (*NatsDevice, error)

NewNatsDevice returns a NatsDevice

func NewNatsDeviceFromConfig

func NewNatsDeviceFromConfig(config programconfig.Config, nc *nats.Conn, ec *nats.EncodedConn, handler modbus.ClientHandler, logger log.Logger) (*NatsDevice, error)

NewNatsDeviceFromConfig initiates NatsDevice from config

func (*NatsDevice) ClearSubs

func (d *NatsDevice) ClearSubs()

ClearSubs clear all subscriptions

func (*NatsDevice) Handle

func (d *NatsDevice) Handle(ctx context.Context)

Handle goes monitor

type NatsMessage added in v0.0.3

type NatsMessage struct {
	Result interface{} `json:"res"`
	Err    error       `json:"err,omitempty"`
}

NatsMessage is a

Jump to

Keyboard shortcuts

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