ws

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WSHandler

func WSHandler(hub *Hub) fiber.Handler

func WSUpgrader

func WSUpgrader(hub *Hub) fiber.Handler

Types

type BroadcastMessage

type BroadcastMessage struct {
	Channel string
	Message []byte
}

type Client

type Client struct {
	Connection *websocket.Conn
	Send       chan []byte
	Channel    string
}

type Hub

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

func NewHub

func NewHub() *Hub

func (*Hub) Broadcast

func (h *Hub) Broadcast(channel string, data any)

func (*Hub) Register

func (h *Hub) Register(client *Client)

func (*Hub) Run

func (h *Hub) Run()

func (*Hub) Unregister

func (h *Hub) Unregister(client *Client)

Jump to

Keyboard shortcuts

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