clients

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 2 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 {
	Id   string
	Data ClientData
	// contains filtered or unexported fields
}

type ClientData

type ClientData map[string]interface{}

type ClientType

type ClientType uint8
const (
	SseClient ClientType = 1
	WsClient  ClientType = 2
)

func (ClientType) IsValid

func (ct ClientType) IsValid() bool

type Clients

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

func New

func New() *Clients

func (*Clients) FuncIterationForClients

func (m *Clients) FuncIterationForClients(fn func(client *Client, isConnected bool) bool) bool

func (*Clients) GetRegisteredClients

func (m *Clients) GetRegisteredClients() int

func (*Clients) PurgeDisconnected

func (m *Clients) PurgeDisconnected()

func (*Clients) RegisterNewClient

func (m *Clients) RegisterNewClient(clientType ClientType) *Client

func (*Clients) RegisterNewClientWithData

func (m *Clients) RegisterNewClientWithData(clientType ClientType, data ClientData) *Client

func (*Clients) RemoveClient

func (manager *Clients) RemoveClient(conn *Client)

func (*Clients) SetDisconnected

func (manager *Clients) SetDisconnected(conn *Client)

Jump to

Keyboard shortcuts

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