ws

package
v0.0.0-...-8fb26ab Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 7 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 {
	// contains filtered or unexported fields
}

func New

func New(onMessage func([]byte)) *Client

func (*Client) Close

func (client *Client) Close() error

func (*Client) Connect

func (client *Client) Connect(url url.URL, header http.Header) error

func (*Client) Ping

func (client *Client) Ping(ctx context.Context, cancel context.CancelFunc, pingInterval, pingWriteTimeout time.Duration)

func (*Client) Read

func (client *Client) Read(ctx context.Context, cancel context.CancelFunc)

func (*Client) SetHandlers

func (client *Client) SetHandlers(pingWriteTimeout, pingReadTimeout time.Duration)

Note: this is required to fulfill the websocket protocol.

func (*Client) Subscribe

func (client *Client) Subscribe(handshake map[string]any) error

Jump to

Keyboard shortcuts

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