Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Close()
- func (c *Client) Connect() error
- func (c *Client) JoinVoice(boardId, peerId string) error
- func (c *Client) LeaveVoice(boardId, peerId string) error
- func (c *Client) OnVoiceJoin(callback func(peerId string))
- func (c *Client) OnVoiceLeave(callback func(peerId string))
- func (c *Client) OnVoiceSignal(callback func(fromPeerId string, signal map[string]interface{}))
- func (c *Client) SendSignal(toPeerId, fromPeerId string, signal map[string]interface{}) error
Constants ¶
View Source
const ( EngineIoOpen = "0" EngineIoClose = "1" EngineIoPing = "2" EngineIoPong = "3" EngineIoMessage = "4" SocketIoConnect = "0" SocketIoDisconnect = "1" SocketIoEvent = "2" SocketIoAck = "3" SocketIoError = "4" SocketIoBinaryEvent = "5" SocketIoBinaryAck = "6" )
Socket.io standard packet types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Socket.io websocket connection wrapper for Syncoboard's WebRTC signaling
func NewClient ¶
NewClient creates a new WebSocket client websocketUrl should be the base URL to the websocket server, e.g., "ws://localhost:3002"
func (*Client) LeaveVoice ¶
LeaveVoice Leaves a specific board's voice channel
func (*Client) OnVoiceJoin ¶
OnVoiceJoin Registers a callback for when a peer joins the board's voice channel
func (*Client) OnVoiceLeave ¶
OnVoiceLeave Registers a callback for when a peer leaves the board's voice channel
func (*Client) OnVoiceSignal ¶
OnVoiceSignal Registers a callback for receiving WebRTC signals from other peers
Click to show internal directories.
Click to hide internal directories.