wsconn

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: 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 Conn

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

Conn is a single WS connection

func (*Conn) WriteData

func (c *Conn) WriteData(data any) error

WriteData writes arbitrary data to the WS connection

type Conns

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

Conns manages active WS connections

func NewConns

func NewConns(logger *zap.Logger) *Conns

NewConns creates a new instance of the WS connection manager

func (*Conns) AddWSConnection

func (pw *Conns) AddWSConnection(id string, session *melody.Session)

AddWSConnection registers a new WS connection

func (*Conns) GetWSConnection

func (pw *Conns) GetWSConnection(id string) conns.WSConnection

GetWSConnection fetches a WS connection, if any

func (*Conns) RemoveWSConnection

func (pw *Conns) RemoveWSConnection(id string)

RemoveWSConnection removes an existing WS connection

Jump to

Keyboard shortcuts

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