Help us shape the future of Go! Take the 2026 Go Developer Survey

websocketclient

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package websocketclient is deprecated.

Deprecated: use github.com/rosenlo/toolkits/wsclient instead. The wsclient package supersedes this one with reconnect-friendly fields (Name, msgCount, connectedAt), a longer 5-minute readTimeout, PingPong, and richer error logs. This package is retained for backwards compatibility and may be removed in a future major release.

Index

Constants

View Source
const (
	MetricMessageChan = "wsp_message_channel_size"
)

Variables

View Source
var MessageChanLabel = []string{"url"}

Functions

This section is empty.

Types

type Client

type Client struct {
	URL *url.URL
	// contains filtered or unexported fields
}

func New

func New(addr string) (*Client, error)

func (*Client) Recv

func (c *Client) Recv(ctx context.Context, messageCh chan<- Message)

func (*Client) Stop

func (c *Client) Stop()

type Message

type Message struct {
	Type        int
	Body        []byte
	ReceiveTime time.Time
}

Jump to

Keyboard shortcuts

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