conns

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionManager

type ConnectionManager interface {
	// AddWSConnection registers a new WS connection
	AddWSConnection(id string, session *melody.Session)

	// RemoveWSConnection Removes the WS connection with the supplied ID
	RemoveWSConnection(id string)

	// GetWSConnection fetches a WS connection, if any, using the supplied ID
	GetWSConnection(id string) WSConnection
}

ConnectionManager defines a connection manager interface for active WS connections

type WSConnection

type WSConnection interface {
	// WriteData pushes out data to the WS connection.
	// Returns an error if the write failed (ex. connection closed)
	WriteData(data any) error
}

WSConnection represents a single WS connection

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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