ws

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0, 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 Client

type Client struct {
	EventChannel chan *model.WebSocketEvent
	// contains filtered or unexported fields
}

Client is the websocket client to perform all actions.

func NewClient

func NewClient(param *ClientParams) (*Client, error)

NewClient constructs a new WebSocket client.

func (*Client) Close

func (c *Client) Close()

Close closes the client.

func (*Client) SendBinaryMessage

func (c *Client) SendBinaryMessage(action string, data map[string]interface{}) error

SendBinaryMessage is the method to write to the websocket using binary data type (MessagePack encoded).

func (*Client) SendMessage

func (c *Client) SendMessage(action string, data map[string]interface{}) error

SendMessage is the method to write to the websocket.

type ClientParams

type ClientParams struct {
	WsURL          string
	AuthToken      string
	ConnID         string
	ServerSequence int64
}

Jump to

Keyboard shortcuts

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