proto

package
v0.0.0-...-aa1a986 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 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 AppMsgType

type AppMsgType uint8
const (
	MsgReqSystemInfo           AppMsgType = 0x16
	MsgReqSystemStatus         AppMsgType = 0x18
	MsgReqSystemTroubles       AppMsgType = 0x1A
	MsgReqSystemFeatures       AppMsgType = 0x1C
	MsgReqSystemFormats        AppMsgType = 0x28
	MsgReqObjectTypeCapacities AppMsgType = 0x1E
	MsgReqObjectProperties     AppMsgType = 0x20
	MsgReqObjectStatus         AppMsgType = 0x22
)

type Conn

type Conn interface {
	Read(timeout time.Duration) (*Msg, error)
	Write(m *Msg, timeout time.Duration) error
	Close() error
}

Conn is a stateful connection/session to the controller for sending application data messages.

Multiple goroutines may invoke methods on a Conn simultaneously.

func NewConnection

func NewConnection(addr string, key StaticKey) (Conn, error)

NewConnection will create a new connection and session with the controller.

type ConnError

type ConnError struct {
	// Op is the operation which caused the error, such as "read" or "write".
	Op string
	// Addr is the network address of the connection
	Addr string

	// Err is the error that occurred during the operation.
	Err error
}

func (ConnError) Error

func (ce ConnError) Error() string

type Msg

type Msg struct {
	Type AppMsgType
	Data []byte
}

Msg is the raw application data message

func NewMsg

func NewMsg(p *packet) (*Msg, error)

NewMsg creates a Msg from a packet received by a connection.

func (*Msg) Reader

func (m *Msg) Reader() io.Reader

Reader returns an io.Reader from the underlying message data.

type StaticKey

type StaticKey []byte

Jump to

Keyboard shortcuts

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