websocket

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessData

func ProcessData(c *Client, msg *WsMsg)

Types

type Client

type Client struct {
	ID     string
	Socket *websocket.Conn
	Msg    chan []byte
}

func NewWsClient

func NewWsClient(ID string, socket *websocket.Conn) *Client

func (*Client) Read

func (c *Client) Read()

func (*Client) Write

func (c *Client) Write()

type Manager

type Manager struct {
	Group                map[string]*Client
	Lock                 sync.Mutex
	Register, UnRegister chan *Client
	ClientCount          uint
}

func (*Manager) RegisterClient

func (m *Manager) RegisterClient(client *Client)

func (*Manager) Start

func (m *Manager) Start()

func (*Manager) UnRegisterClient

func (m *Manager) UnRegisterClient(client *Client)

type WsMsg

type WsMsg struct {
	Type string
	Keys []string
}

Jump to

Keyboard shortcuts

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