connection

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectedHandler

type ConnectedHandler func(conn *Connection)

type Connection

type Connection struct {
	OnConnectionLost LostHandler
	OnConnect        ConnectedHandler
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(url string, token string) *Connection

func (*Connection) Command

func (c *Connection) Command(payload SetId, result any) error

func (*Connection) Connect

func (c *Connection) Connect()

func (*Connection) Disconnect

func (c *Connection) Disconnect()

func (*Connection) SubscribeStateEvents

func (c *Connection) SubscribeStateEvents(entityId string, handler StateEventHandler) error

func (*Connection) UnsubscribeStateEvents

func (c *Connection) UnsubscribeStateEvents(entityId string) error

type LostHandler

type LostHandler func(conn *Connection, err error)

type SetId

type SetId interface {
	SetId(seq uint64)
}

type StateEventHandler

type StateEventHandler func(entityId string, event msgs.EventResponse)

Jump to

Keyboard shortcuts

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