server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Hub              *Hub
	Conn             *ws.Conn
	PingInterval     time.Duration
	PongWait         time.Duration
	ReadSizeLimit    int64
	WriteMessageType int
	MessagesToSend   chan []byte
	ValidateMessage  func(msg []byte, client *Client) (bool, []byte)
}

func (*Client) CloseConn

func (c *Client) CloseConn()

func (*Client) ReadMessages

func (c *Client) ReadMessages()

func (*Client) WriteMessages

func (c *Client) WriteMessages()

type Hub

type Hub struct {
	Clients     map[*Client]bool
	Subscribe   chan *Client
	Unsubscribe chan *Client
}

func CreateHub

func CreateHub() *Hub

func (*Hub) ClearClient

func (h *Hub) ClearClient(c *Client)

func (*Hub) Run

func (h *Hub) Run()

Jump to

Keyboard shortcuts

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