wsmanager

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

func NewConnection

func NewConnection(conn net.Conn) *Connection

type ConnectionManager

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

func NewConnectionManager

func NewConnectionManager() *ConnectionManager

func (*ConnectionManager) AddClient

func (cm *ConnectionManager) AddClient(conn *Connection)

func (*ConnectionManager) Broadcast

func (cm *ConnectionManager) Broadcast(msg Message, sender *Connection)

func (*ConnectionManager) RemoveClient

func (cm *ConnectionManager) RemoveClient(conn *Connection)

func (*ConnectionManager) Subscribe

func (cm *ConnectionManager) Subscribe(conn *Connection, topic string)

type Message

type Message struct {
	ID      string          `json:"id"`
	Topic   string          `json:"topic"`
	Payload json.RawMessage `json:"payload"`
	Sender  *Connection     `json:"-"`
}

Jump to

Keyboard shortcuts

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