websocket

package
v0.0.0-...-a2bc6c4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WebSocketHandler

func WebSocketHandler(broadcaster *Broadcaster) http.Handler

Types

type Broadcaster

type Broadcaster struct {
	// contains filtered or unexported fields
}

func NewBroadcaster

func NewBroadcaster() *Broadcaster

func (*Broadcaster) AddClient

func (b *Broadcaster) AddClient(client *Client)

func (*Broadcaster) Broadcast

func (b *Broadcaster) Broadcast(message []byte)

func (*Broadcaster) RemoveClient

func (b *Broadcaster) RemoveClient(client *Client)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conn *websocket.Conn) *Client

func (*Client) ReadPump

func (c *Client) ReadPump()

func (*Client) Send

func (c *Client) Send(message []byte)

func (*Client) WritePump

func (c *Client) WritePump()

type ClientOption

type ClientOption func(*Client)

func WithSendChannel

func WithSendChannel(send chan []byte) ClientOption

Jump to

Keyboard shortcuts

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