Documentation ¶
Index ¶
- func HandleGateway(frags *config.ProxyFlags, watch *utils.RecordWatcher, ...) http.Handler
- type AdminRequest
- type AllowSpeak
- type CancelRaiseHand
- type Create
- type DeniedSpeak
- type DenySpeak
- type Destroy
- type Error
- type ExternalAdaptor
- type ExternalAdaptorType
- type ExternalEventType
- type JanusClient
- func (a *JanusClient) Close() error
- func (a *JanusClient) Connect() error
- func (a *JanusClient) Create(capacity int) error
- func (a *JanusClient) Destroy() error
- func (a *JanusClient) MetaFile() string
- func (a *JanusClient) Reader(conn *websocket.Conn)
- func (a *JanusClient) RecordFile() string
- func (a *JanusClient) WorkDir() string
- func (a *JanusClient) Writer(conn *websocket.Conn)
- type Join
- type Joined
- type JoinedAsListener
- type KickSpeak
- type KickedSpeak
- type ListParticipants
- type Metadata
- type Participant
- type Participants
- type RaiseHand
- type RaisedHand
- type StoppedTalking
- type Talking
- type Trickle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleGateway ¶
func HandleGateway(frags *config.ProxyFlags, watch *utils.RecordWatcher, storage utils.TokenStorage) http.Handler
Types ¶
type AdminRequest ¶
type AdminRequest struct {
RoomID string `json:"room_id"`
}
type AllowSpeak ¶
type AllowSpeak struct {
UserID string
}
func ParseAsAllowSpeakRequest ¶
func ParseAsAllowSpeakRequest(body map[string]interface{}) *AllowSpeak
type CancelRaiseHand ¶
type CancelRaiseHand struct {
UserID string
}
func ParseAsCancelRaiseHandRequest ¶
func ParseAsCancelRaiseHandRequest(userID string) *CancelRaiseHand
type Create ¶
type Create struct { Request string `json:"request"` AdminKey string `json:"admin_key"` RoomID string `json:"room"` Secret string `json:"secret"` IsPrivate bool `json:"is_private"` SeatToken []string `json:"allowed"` SamplingRate int `json:"sampling_rate"` AudioActivePackets int `json:"audio_active_packets"` AudiolevelEvent bool `json:"audiolevel_event"` AudioLevelAverage int `json:"audio_level_average"` Record bool `json:"record"` RecordFile string `json:"record_file"` }
type DeniedSpeak ¶
func (*DeniedSpeak) MarshalAsOutputEvent ¶
func (a *DeniedSpeak) MarshalAsOutputEvent() *ExternalAdaptor
type Destroy ¶
type Destroy struct { Request string `json:"request"` RoomID string `json:"room"` Secret string `json:"secret"` }
func NewDestroy ¶
func NewListParticipants ¶
type Error ¶
type Error struct {
Reason string `json:"reason"`
}
func (*Error) OutputEvent ¶
func (a *Error) OutputEvent() *ExternalAdaptor
type ExternalAdaptor ¶
type ExternalAdaptor struct { Type string `json:"type"` Body interface{} `json:"body"` }
func (*ExternalAdaptor) BodyAsMap ¶
func (a *ExternalAdaptor) BodyAsMap() map[string]interface{}
type ExternalAdaptorType ¶
type ExternalAdaptorType = string
const ( /* body: everyone {"sdp": {}} */ RequestTypeJoin ExternalAdaptorType = "join" /* body: everyone {"candidate": {}} */ RequestTypeTrickle ExternalAdaptorType = "trickle" /* body: everyone {} */ RequestTypeRaiseHand ExternalAdaptorType = "raise_hand" /* body: everyone {} */ RequestTypeCancelRaiseHand ExternalAdaptorType = "cancel_raise_hand" /* body: only author {"user_id": ""} */ RequestTypeAllowSpeak ExternalAdaptorType = "allow_speak" /* body: only author {"user_id": ""} */ RequestTypeDenySpeak ExternalAdaptorType = "deny_speak" /* body: only author {"user_id": ""} */ RequestTypeKickSpeak ExternalAdaptorType = "kick_speak" )
{"type": "", "body": {}}
type ExternalEventType ¶
type ExternalEventType = string
const ( /* body: to myself {"success": true, "id": "0 | 1 | 2 | 3 | 4 | 5", "user_id": "", "sdp": {}} */ EventTypeJoined ExternalEventType = "joined" /* body: to myself {"success": true, "user_id": "", "sdp": {}} */ EventTypeJoinedAsListener ExternalEventType = "joined_as_listener" /* body: to everyone {"success": true, "user_id": ""} */ EventTypeRaisedHand ExternalEventType = "raised_hand" /* body: to everyone {"success": true, "user_id": ""} */ EventTypeDeniedSpeak ExternalEventType = "denied_speak" /* body: to everyone {"success": true, "user_id": ""} */ EventTypeKickedSpeak ExternalEventType = "kicked_speak" /* body: to everyone [{"id", "0 | 1 | 2 | 3 | 4 | 5", "user_id": "", "role": "author | guest | listener"}] */ EventTypeParticipants ExternalEventType = "participants" /* body: to everyone {"id": "0 | 1 | 2 | 3 | 4 | 5"} */ EventTypeTalking ExternalEventType = "talking" /* body: to everyone {"id": "0 | 1 | 2 | 3 | 4 | 5"} */ EventTypeStoppedTalking ExternalEventType = "stopped_talking" /* body: to myself {"reason": ""} */ EventTypeError ExternalEventType = "error" )
type JanusClient ¶
type JanusClient struct {
// contains filtered or unexported fields
}
func NewJanusClient ¶
func NewJanusClient(wsUri string, roomID, userID string, isAuthor, isListener bool) *JanusClient
func (*JanusClient) Close ¶
func (a *JanusClient) Close() error
func (*JanusClient) Connect ¶
func (a *JanusClient) Connect() error
func (*JanusClient) Create ¶
func (a *JanusClient) Create(capacity int) error
func (*JanusClient) Destroy ¶
func (a *JanusClient) Destroy() error
func (*JanusClient) MetaFile ¶
func (a *JanusClient) MetaFile() string
func (*JanusClient) Reader ¶
func (a *JanusClient) Reader(conn *websocket.Conn)
func (*JanusClient) RecordFile ¶
func (a *JanusClient) RecordFile() string
func (*JanusClient) WorkDir ¶
func (a *JanusClient) WorkDir() string
func (*JanusClient) Writer ¶
func (a *JanusClient) Writer(conn *websocket.Conn)
type Join ¶
type Joined ¶
type Joined struct { ID string `json:"id"` UserID string `json:"user_id"` AnswerSdp interface{} `json:"sdp"` Success bool `json:"success"` }
func (*Joined) MarshalAsOutputEvent ¶
func (a *Joined) MarshalAsOutputEvent() *ExternalAdaptor
type JoinedAsListener ¶
type JoinedAsListener struct { UserID string `json:"user_id"` AnswerSdp interface{} `json:"sdp"` Success bool `json:"success"` }
func (*JoinedAsListener) MarshalAsOutputEvent ¶
func (a *JoinedAsListener) MarshalAsOutputEvent() *ExternalAdaptor
type KickedSpeak ¶
func (*KickedSpeak) MarshalAsOutputEvent ¶
func (a *KickedSpeak) MarshalAsOutputEvent() *ExternalAdaptor
type ListParticipants ¶
type Metadata ¶
type Metadata struct { Timestamp int64 `json:"timestamp"` Data interface{} `json:"data"` }
type Participant ¶
type Participants ¶
type Participants []Participant
func (Participants) HaveSeatToken ¶
func (a Participants) HaveSeatToken(token string) bool
func (Participants) MarshalAsOutputEvent ¶
func (a Participants) MarshalAsOutputEvent() *ExternalAdaptor
type RaisedHand ¶
func (*RaisedHand) MarshalAsOutputEvent ¶
func (a *RaisedHand) MarshalAsOutputEvent() *ExternalAdaptor
type StoppedTalking ¶
type StoppedTalking struct {
UserID string `json:"id"`
}
func (*StoppedTalking) MarshalAsOutputEvent ¶
func (a *StoppedTalking) MarshalAsOutputEvent() *ExternalAdaptor
type Talking ¶
type Talking struct {
UserID string `json:"id"`
}
func (*Talking) MarshalAsOutputEvent ¶
func (a *Talking) MarshalAsOutputEvent() *ExternalAdaptor
Click to show internal directories.
Click to hide internal directories.