Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) Close()
- func (c *Client) GetID() string
- func (c *Client) Heartbeat()
- func (c *Client) Listen()
- func (c *Client) Receive(id string, f func(request WSPacket) (response WSPacket))
- func (c *Client) Send(request WSPacket, callback func(response WSPacket))
- func (c *Client) SyncSend(request WSPacket) (response WSPacket)
- type WSPacket
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyPacket = WSPacket{}
EmptyPacket represents an empty packet
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Done chan struct{} // contains filtered or unexported fields }
type WSPacket ¶
type WSPacket struct { Type string `json:"type"` // TODO: Make Data generic: map[string]interface{} for more usecases Data string `json:"data"` PacketID string `json:"packet_id"` // Globally ID of a browser session SessionID string `json:"session_id"` }
WSPacket represents a websocket packet
Click to show internal directories.
Click to hide internal directories.