Documentation ¶
Index ¶
Constants ¶
View Source
const ( Initial ConnectionState = 0 WaitingForStream = 1 Streamer = 2 Viewer = 4 Disconnected = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a middleman between the websocket connection and the hub.
func NewClient ¶
func NewClient(hub *Hub, conn *SafeConnection) Client
func (*Client) WritePump ¶
func (c *Client) WritePump()
writePump pumps messages from the hub to the websocket connection.
A goroutine running writePump is started for each connection. The application ensures that there is at most one writer to a connection by executing all writes from this goroutine.
type ConnectionState ¶
type ConnectionState int32
type ErrorMessage ¶
type ErrorType ¶
type ErrorType string
const ( Unknown ErrorType = "Unknown" InvalidMessage = "Invalid Message" )
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to the clients.
type JoinRoomMessage ¶
type JoinRoomMessage struct {
RoomId string `json:"roomId"`
}
type MessageWrapper ¶
type MessageWrapper struct { Type messages.MessageType `json:"type"` Message json.RawMessage `json:"message"` }
type RoomInfo ¶
type RoomInfo struct { VideoStream *webrtc.TrackLocalStaticRTP AudioStream *webrtc.TrackLocalStaticRTP // contains filtered or unexported fields }
func (*RoomInfo) GetClientsInRoom ¶
type RoomMessage ¶
type RoomMessage struct {
// contains filtered or unexported fields
}
type StartStreamInfoMessage ¶
type StartStreamInfoMessage struct {
StreamStartSuccess bool `json:"startStreamSuccess"`
}
type StreamerMessage ¶
type StreamerMessage struct {
RoomHasStreamer bool `json:"roomHasStreamer"`
}
type ViewerMessage ¶
type ViewerMessage struct {
Viewers uint32 `json:"viewers"`
}
Click to show internal directories.
Click to hide internal directories.