Documentation ¶
Index ¶
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) Connect() error
- func (c *Connection) IsConnected() bool
- func (c *Connection) Register(id int, key string, permissions []string) error
- func (c *Connection) Request(id int, uri string, payload interface{}, result interface{}) error
- func (c *Connection) Subscribe(id int, uri string) (chan Response, error)
- type Response
- type Timeouts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { OnConnect func(*Connection) OnDisconnect func(*Connection, error) // contains filtered or unexported fields }
Connection represents a websocket connection to a LG TV
func NewConnection ¶
func NewConnection(url string, t Timeouts) *Connection
NewConnection creates a new connection to a LG TV with the specified timeouts
func (*Connection) Close ¶
func (c *Connection) Close() error
Close sends a close control message and disconnects from the LG TV
func (*Connection) Connect ¶
func (c *Connection) Connect() error
Connect tries to establish a connection to the LG TV
func (*Connection) IsConnected ¶
func (c *Connection) IsConnected() bool
IsConnected returns whether or not a connection to the LG TV is established
func (*Connection) Register ¶
func (c *Connection) Register(id int, key string, permissions []string) error
Register sends registration request to the LG TV
Click to show internal directories.
Click to hide internal directories.