dummy_ws

package
v0.0.0-...-9ebb391 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserMap            *ClientsMap   = NewClientsMap()
	SubscribedUsersMap *ClientsMap   = NewClientsMap()
	Id_Gen             *id_Generator = &id_Generator{
		start_ID: 0,
	}
	ConnUpgrader = websocket.Upgrader{}
)

Functions

func EchoDummyWS

func EchoDummyWS(c echo.Context) error

Types

type Client

type Client struct {
	Id   string
	Conn *websocket.Conn
}

type ClientsMap

type ClientsMap struct {
	Clients map[string]Client
	// contains filtered or unexported fields
}

func NewClientsMap

func NewClientsMap() *ClientsMap

func (*ClientsMap) AddClient

func (c *ClientsMap) AddClient(clientID string, client *Client)

func (*ClientsMap) DeleteClient

func (c *ClientsMap) DeleteClient(clientID string)

func (*ClientsMap) GetClient

func (c *ClientsMap) GetClient(clientID string) (Client, bool)

Returns the client if found. Else returns false

func (*ClientsMap) GetClientsStr

func (c *ClientsMap) GetClientsStr() string

Returns a string of all the online clients

Jump to

Keyboard shortcuts

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