Documentation
¶
Index ¶
- func Broadcast(relays []*structs.Relay, channel string, message interface{})
- func Code(r *structs.Relay, code string, channel string, message interface{}, ...) error
- func HandleAnswer(r *structs.Relay, answer *webrtc.SessionDescription)
- func HandleIce(r *structs.Relay, ice *webrtc.ICECandidateInit)
- func MakeAnswerFromOffer(r *structs.Relay, offer *webrtc.SessionDescription) *webrtc.SessionDescription
- func MakeOffer(r *structs.Relay) *webrtc.SessionDescription
- func Send(r *structs.Relay, channel string, message interface{}) error
- func Spawn(s *structs.Server, ugi string, lobby string, peer *structs.Client) *structs.Relay
- type Relay
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Broadcast ¶
Broadcast sends the given message to all the given DataChannels. If the message is a RelayPacket, it will be marshaled using go-json before being sent. If a channel is nil, it is skipped.
func Code ¶
func Code(r *structs.Relay, code string, channel string, message interface{}, origin *structs.PeerInfo) error
Code sends a RelayPacket over the given DataChannel with the given opcode and optional payload. If the channel is nil, it logs the error and returns nil.
The payload is marshaled using go-json. If the origin is not nil, it is included in the RelayPacket.
func HandleAnswer ¶
func MakeAnswerFromOffer ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.