Documentation ¶
Overview ¶
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2020 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2020 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2020 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2019 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Contents heavily based on
- https://github.com/notedit/janus-go/blob/master/janus.go *
- Added error handling and improve functionality.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2020 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2017 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2019 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2019 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2019 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- Standalone signaling server for the Nextcloud Spreed app.
- Copyright (C) 2019 struktur AG *
- @author Joachim Bauch <bauch@struktur.de> *
- @license GNU AGPL version 3 or any later version *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func AddBackendChecksum(r *http.Request, body []byte, secret []byte)
- func CalculateBackendChecksum(random string, body []byte, secret []byte) string
- func ContinentsOverlap(a, b []string) bool
- func GetEncodedSubject(prefix string, suffix string) string
- func GetGeoIpDownloadUrl(license string) string
- func GetSubjectForBackendRoomId(roomId string, backend *Backend) string
- func GetSubjectForRoomId(roomId string, backend *Backend) string
- func GetSubjectForUserId(userId string, backend *Backend) string
- func GetVirtualSessionId(session *ClientSession, sessionId string) string
- func IsInCall(value interface{}) (bool, bool)
- func IsValidCountry(country string) bool
- func LookupContinents(country string) []string
- func ValidateBackendChecksum(r *http.Request, body []byte, secret []byte) bool
- func ValidateBackendChecksumValue(checksum string, random string, body []byte, secret []byte) bool
- type AddSessionInternalClientMessage
- type AddSessionOptions
- type AnswerOfferMessage
- type Backend
- type BackendClient
- func (b *BackendClient) GetBackend(u *url.URL) *Backend
- func (b *BackendClient) GetBackends() []*Backend
- func (b *BackendClient) GetCompatBackend() *Backend
- func (b *BackendClient) IsUrlAllowed(u *url.URL) bool
- func (b *BackendClient) PerformJSONRequest(ctx context.Context, u *url.URL, request interface{}, response interface{}) error
- func (b *BackendClient) Reload(config *goconf.ConfigFile)
- type BackendClientAuthRequest
- type BackendClientAuthResponse
- type BackendClientPingRequest
- type BackendClientRequest
- func NewBackendClientAuthRequest(params *json.RawMessage) *BackendClientRequest
- func NewBackendClientPingRequest(roomid string, entries []BackendPingEntry) *BackendClientRequest
- func NewBackendClientRoomRequest(roomid string, userid string, sessionid string) *BackendClientRequest
- func NewBackendClientSessionRequest(roomid string, action string, sessionid string, ...) *BackendClientRequest
- type BackendClientResponse
- type BackendClientRingResponse
- type BackendClientRoomRequest
- type BackendClientRoomResponse
- type BackendClientSessionRequest
- type BackendClientSessionResponse
- type BackendConfiguration
- func (b *BackendConfiguration) GetBackend(u *url.URL) *Backend
- func (b *BackendConfiguration) GetBackends() []*Backend
- func (b *BackendConfiguration) GetCompatBackend() *Backend
- func (b *BackendConfiguration) GetSecret(u *url.URL) []byte
- func (b *BackendConfiguration) IsUrlAllowed(u *url.URL) bool
- func (b *BackendConfiguration) Reload(config *goconf.ConfigFile)
- func (b *BackendConfiguration) RemoveBackendsForHost(host string)
- func (b *BackendConfiguration) UpsertHost(host string, backends []*Backend)
- type BackendPingEntry
- type BackendRoomDeleteRequest
- type BackendRoomDisinviteRequest
- type BackendRoomInCallRequest
- type BackendRoomInviteRequest
- type BackendRoomMessageRequest
- type BackendRoomParticipantsRequest
- type BackendRoomUpdateRequest
- type BackendServer
- type BackendServerRoomRequest
- type BuiltinRoomSessions
- type ByeClientMessage
- type ByeProxyClientMessage
- type ByeProxyServerMessage
- type ByeServerMessage
- type Client
- func (c *Client) Close()
- func (c *Client) Country() string
- func (c *Client) GetSession() *ClientSession
- func (c *Client) IsAuthenticated() bool
- func (c *Client) IsConnected() bool
- func (c *Client) ReadPump()
- func (c *Client) RemoteAddr() string
- func (c *Client) SendByeResponse(message *ClientMessage) bool
- func (c *Client) SendByeResponseWithReason(message *ClientMessage, reason string) bool
- func (c *Client) SendError(e *Error) bool
- func (c *Client) SendMessage(message WritableClientMessage) bool
- func (c *Client) SetConn(conn *websocket.Conn, remoteAddress string)
- func (c *Client) SetSession(session *ClientSession)
- func (c *Client) UserAgent() string
- func (c *Client) WritePump()
- type ClientMessage
- type ClientSession
- func (s *ClientSession) AddVirtualSession(session *VirtualSession)
- func (s *ClientSession) Backend() *Backend
- func (s *ClientSession) BackendUrl() string
- func (s *ClientSession) ClearClient(client *Client)
- func (s *ClientSession) ClientType() string
- func (s *ClientSession) Close()
- func (s *ClientSession) Data() *SessionIdData
- func (s *ClientSession) GetClient() *Client
- func (s *ClientSession) GetFeatures() []string
- func (s *ClientSession) GetOrCreatePublisher(ctx context.Context, mcu Mcu, streamType string) (McuPublisher, error)
- func (s *ClientSession) GetOrCreateSubscriber(ctx context.Context, mcu Mcu, id string, streamType string) (McuSubscriber, error)
- func (s *ClientSession) GetPublisher(streamType string) McuPublisher
- func (s *ClientSession) GetRoom() *Room
- func (s *ClientSession) GetSubscriber(id string, streamType string) McuSubscriber
- func (s *ClientSession) HasFeature(feature string) bool
- func (s *ClientSession) HasPermission(permission Permission) bool
- func (s *ClientSession) IsExpired(now time.Time) bool
- func (s *ClientSession) LeaveCall()
- func (s *ClientSession) LeaveRoom(notify bool) *Room
- func (s *ClientSession) NotifySessionResumed(client *Client)
- func (s *ClientSession) OnIceCandidate(client McuClient, candidate interface{})
- func (s *ClientSession) OnIceCompleted(client McuClient)
- func (s *ClientSession) ParsedBackendUrl() *url.URL
- func (s *ClientSession) PrivateId() string
- func (s *ClientSession) PublicId() string
- func (s *ClientSession) PublisherClosed(publisher McuPublisher)
- func (s *ClientSession) RemoveVirtualSession(session *VirtualSession)
- func (s *ClientSession) RoomSessionId() string
- func (s *ClientSession) SendMessage(message *ServerMessage) bool
- func (s *ClientSession) SendMessages(messages []*ServerMessage) bool
- func (s *ClientSession) SetClient(client *Client) *Client
- func (s *ClientSession) SetPermissions(permissions []Permission)
- func (s *ClientSession) SetRoom(room *Room)
- func (s *ClientSession) StartExpire()
- func (s *ClientSession) StopExpire()
- func (s *ClientSession) SubscribeNats(n NatsClient) error
- func (s *ClientSession) SubscribeRoomNats(n NatsClient, roomid string, roomSessionId string) error
- func (s *ClientSession) SubscriberClosed(subscriber McuSubscriber)
- func (s *ClientSession) UnsubscribeRoomNats()
- func (s *ClientSession) UserData() *json.RawMessage
- func (s *ClientSession) UserId() string
- type ClientTypeInternalAuthParams
- type CommandProxyClientMessage
- type CommandProxyServerMessage
- type CommonSessionInternalClientMessage
- type ConcurrentStringStringMap
- type ControlClientMessage
- type ControlServerMessage
- type DeferredExecutor
- type Error
- type EventProxyServerMessage
- type EventServerMessage
- type EventServerMessageSessionEntry
- type GatewayListener
- type GeoLookup
- type HelloClientMessage
- type HelloClientMessageAuth
- type HelloProxyClientMessage
- type HelloProxyServerMessage
- type HelloServerMessage
- type HelloServerMessageServer
- type HttpClientPool
- type Hub
- type InfoMsg
- type InternalClientMessage
- type JanusGateway
- type JanusHandle
- func (handle *JanusHandle) Detach(ctx context.Context) (*janus.AckMsg, error)
- func (handle *JanusHandle) Message(ctx context.Context, body, jsep interface{}) (*janus.EventMsg, error)
- func (handle *JanusHandle) Request(ctx context.Context, body interface{}) (*janus.SuccessMsg, error)
- func (handle *JanusHandle) Trickle(ctx context.Context, candidate interface{}) (*janus.AckMsg, error)
- func (handle *JanusHandle) TrickleMany(ctx context.Context, candidates interface{}) (*janus.AckMsg, error)
- type JanusSession
- type LoopbackNatsClient
- func (c *LoopbackNatsClient) Decode(msg *nats.Msg, v interface{}) error
- func (c *LoopbackNatsClient) Publish(subject string, message interface{}) error
- func (c *LoopbackNatsClient) PublishBackendServerRoomRequest(subject string, message *BackendServerRoomRequest) error
- func (c *LoopbackNatsClient) PublishMessage(subject string, message *ServerMessage) error
- func (c *LoopbackNatsClient) PublishNats(subject string, message *NatsMessage) error
- func (c *LoopbackNatsClient) Request(subject string, data []byte, timeout time.Duration) (*nats.Msg, error)
- func (c *LoopbackNatsClient) Subscribe(subject string, ch chan *nats.Msg) (NatsSubscription, error)
- type LruCache
- type Mcu
- type McuClient
- type McuInitiator
- type McuListener
- type McuPublisher
- type McuSubscriber
- type MessageClientMessage
- type MessageClientMessageData
- type MessageClientMessageRecipient
- type MessageServerMessage
- type MessageServerMessageData
- type MessageServerMessageDataChat
- type MessageServerMessageSender
- type NatsClient
- type NatsMessage
- type NatsSubscription
- type OcsBody
- type OcsMeta
- type OcsResponse
- type PayloadProxyClientMessage
- type PayloadProxyServerMessage
- type Permission
- type ProxyClientMessage
- type ProxyInformationEtcd
- type ProxyServerMessage
- type RemoveSessionInternalClientMessage
- type Room
- func (r *Room) AddSession(session Session, sessionData *json.RawMessage) []Session
- func (r *Room) Backend() *Backend
- func (r *Room) Close() []Session
- func (r *Room) HasSession(session Session) bool
- func (r *Room) Id() string
- func (r *Room) NotifySessionChanged(session Session)
- func (r *Room) NotifySessionResumed(client *Client)
- func (r *Room) Properties() *json.RawMessage
- func (r *Room) PublishSessionJoined(session Session, sessionData *RoomSessionData)
- func (r *Room) PublishSessionLeft(session Session)
- func (r *Room) PublishUsersChanged(changed []map[string]interface{}, users []map[string]interface{})
- func (r *Room) PublishUsersInCallChanged(changed []map[string]interface{}, users []map[string]interface{})
- func (r *Room) RemoveSession(session Session) bool
- func (r *Room) UpdateProperties(properties *json.RawMessage)
- type RoomClientMessage
- type RoomDisinviteEventServerMessage
- type RoomEventMessage
- type RoomEventServerMessage
- type RoomFlagsServerMessage
- type RoomServerMessage
- type RoomSessionData
- type RoomSessions
- type ServerMessage
- type Session
- type SessionIdData
- type TokenClaims
- type TrickleMsg
- type TurnCredentials
- type UpdateSessionInternalClientMessage
- type VirtualSession
- func (s *VirtualSession) AddFlags(flags uint32) bool
- func (s *VirtualSession) Backend() *Backend
- func (s *VirtualSession) BackendUrl() string
- func (s *VirtualSession) ClientType() string
- func (s *VirtualSession) Close()
- func (s *VirtualSession) Data() *SessionIdData
- func (s *VirtualSession) Flags() uint32
- func (s *VirtualSession) GetRoom() *Room
- func (s *VirtualSession) HasPermission(permission Permission) bool
- func (s *VirtualSession) IsExpired(now time.Time) bool
- func (s *VirtualSession) LeaveRoom(notify bool) *Room
- func (s *VirtualSession) Options() *AddSessionOptions
- func (s *VirtualSession) ParsedBackendUrl() *url.URL
- func (s *VirtualSession) PrivateId() string
- func (s *VirtualSession) PublicId() string
- func (s *VirtualSession) RemoveFlags(flags uint32) bool
- func (s *VirtualSession) Session() *ClientSession
- func (s *VirtualSession) SessionId() string
- func (s *VirtualSession) SetFlags(flags uint32) bool
- func (s *VirtualSession) SetRoom(room *Room)
- func (s *VirtualSession) UserData() *json.RawMessage
- func (s *VirtualSession) UserId() string
- type WritableClientMessage
Constants ¶
const ( BackendVersion = "1.0" HeaderBackendSignalingRandom = "Spreed-Signaling-Random" HeaderBackendSignalingChecksum = "Spreed-Signaling-Checksum" HeaderBackendServer = "Spreed-Signaling-Backend" )
const ( HelloClientTypeClient = "client" HelloClientTypeInternal = "internal" HelloClientTypeVirtual = "virtual" )
const ( // Features for all clients. ServerFeatureMcu = "mcu" // Features for internal clients only. ServerFeatureInternalVirtualSessions = "virtual-sessions" )
const ( RecipientTypeSession = "session" RecipientTypeUser = "user" RecipientTypeRoom = "room" )
const ( DisinviteReasonDisinvited = "disinvited" DisinviteReasonDeleted = "deleted" )
const ( /*! \brief Success (no error) */ JANUS_OK = 0 /*! \brief Unauthorized (can only happen when using apisecret/auth token) */ JANUS_ERROR_UNAUTHORIZED = 403 /*! \brief Unauthorized access to a plugin (can only happen when using auth token) */ JANUS_ERROR_UNAUTHORIZED_PLUGIN = 405 /*! \brief Unknown/undocumented error */ JANUS_ERROR_UNKNOWN = 490 /*! \brief Transport related error */ JANUS_ERROR_TRANSPORT_SPECIFIC = 450 /*! \brief The request is missing in the message */ JANUS_ERROR_MISSING_REQUEST = 452 /*! \brief The gateway does not suppurt this request */ JANUS_ERROR_UNKNOWN_REQUEST = 453 /*! \brief The payload is not a valid JSON message */ JANUS_ERROR_INVALID_JSON = 454 /*! \brief The object is not a valid JSON object as expected */ JANUS_ERROR_INVALID_JSON_OBJECT = 455 /*! \brief A mandatory element is missing in the message */ JANUS_ERROR_MISSING_MANDATORY_ELEMENT = 456 /*! \brief The request cannot be handled for this webserver path */ JANUS_ERROR_INVALID_REQUEST_PATH = 457 /*! \brief The session the request refers to doesn't exist */ JANUS_ERROR_SESSION_NOT_FOUND = 458 /*! \brief The handle the request refers to doesn't exist */ JANUS_ERROR_HANDLE_NOT_FOUND = 459 /*! \brief The plugin the request wants to talk to doesn't exist */ JANUS_ERROR_PLUGIN_NOT_FOUND = 460 /*! \brief An error occurring when trying to attach to a plugin and create a handle */ JANUS_ERROR_PLUGIN_ATTACH = 461 /*! \brief An error occurring when trying to send a message/request to the plugin */ JANUS_ERROR_PLUGIN_MESSAGE = 462 /*! \brief An error occurring when trying to detach from a plugin and destroy the related handle */ JANUS_ERROR_PLUGIN_DETACH = 463 /*! \brief The gateway doesn't support this SDP type * \todo The gateway currently only supports OFFER and ANSWER. */ JANUS_ERROR_JSEP_UNKNOWN_TYPE = 464 /*! \brief The Session Description provided by the peer is invalid */ JANUS_ERROR_JSEP_INVALID_SDP = 465 /*! \brief The stream a trickle candidate for does not exist or is invalid */ JANUS_ERROR_TRICKE_INVALID_STREAM = 466 /*! \brief A JSON element is of the wrong type (e.g., an integer instead of a string) */ JANUS_ERROR_INVALID_ELEMENT_TYPE = 467 /*! \brief The ID provided to create a new session is already in use */ JANUS_ERROR_SESSION_CONFLICT = 468 /*! \brief We got an ANSWER to an OFFER we never made */ JANUS_ERROR_UNEXPECTED_ANSWER = 469 /*! \brief The auth token the request refers to doesn't exist */ JANUS_ERROR_TOKEN_NOT_FOUND = 470 // Error codes of videoroom plugin. JANUS_VIDEOROOM_ERROR_UNKNOWN_ERROR = 499 JANUS_VIDEOROOM_ERROR_NO_MESSAGE = 421 JANUS_VIDEOROOM_ERROR_INVALID_JSON = 422 JANUS_VIDEOROOM_ERROR_INVALID_REQUEST = 423 JANUS_VIDEOROOM_ERROR_JOIN_FIRST = 424 JANUS_VIDEOROOM_ERROR_ALREADY_JOINED = 425 JANUS_VIDEOROOM_ERROR_NO_SUCH_ROOM = 426 JANUS_VIDEOROOM_ERROR_ROOM_EXISTS = 427 JANUS_VIDEOROOM_ERROR_NO_SUCH_FEED = 428 JANUS_VIDEOROOM_ERROR_MISSING_ELEMENT = 429 JANUS_VIDEOROOM_ERROR_INVALID_ELEMENT = 430 JANUS_VIDEOROOM_ERROR_INVALID_SDP_TYPE = 431 JANUS_VIDEOROOM_ERROR_PUBLISHERS_FULL = 432 JANUS_VIDEOROOM_ERROR_UNAUTHORIZED = 433 JANUS_VIDEOROOM_ERROR_ALREADY_PUBLISHED = 434 JANUS_VIDEOROOM_ERROR_NOT_PUBLISHED = 435 JANUS_VIDEOROOM_ERROR_ID_EXISTS = 436 JANUS_VIDEOROOM_ERROR_INVALID_SDP = 437 )
const ( McuTypeJanus = "janus" McuTypeProxy = "proxy" McuTypeDefault = McuTypeJanus )
const ( // Must match values in "Participant.php" from Nextcloud Talk. FlagDisconnected = 0 FlagInCall = 1 FlagWithAudio = 2 FlagWithVideo = 4 FlagWithPhone = 8 )
const ( FLAG_MUTED_SPEAKING = 1 FLAG_MUTED_LISTENING = 2 FLAG_TALKING = 4 )
const (
// Version that must be sent in a "hello" message.
HelloVersion = "1.0"
)
Variables ¶
var ( DefaultFeatures []string DefaultFeaturesInternal []string = []string{ ServerFeatureInternalVirtualSessions, } )
var ( DuplicateClient = NewError("duplicate_client", "Client already registered.") HelloExpected = NewError("hello_expected", "Expected Hello request.") UserAuthFailed = NewError("auth_failed", "The user could not be authenticated.") RoomJoinFailed = NewError("room_join_failed", "Could not join the room.") InvalidClientType = NewError("invalid_client_type", "The client type is not supported.") InvalidBackendUrl = NewError("invalid_backend", "The backend URL is not supported.") InvalidToken = NewError("invalid_token", "The passed token is invalid.") NoSuchSession = NewError("no_such_session", "The session to resume does not exist.") )
var (
ContinentMap map[string][]string = map[string][]string{}/* 254 elements not displayed */
)
var (
ErrDatabaseNotInitialized = fmt.Errorf("GeoIP database not initialized yet")
)
var (
ErrNoSuchRoomSession = fmt.Errorf("unknown room session id")
)
var (
ErrNotConnected = fmt.Errorf("Not connected")
)
var (
ErrUseLastResponse = fmt.Errorf("Use last response")
)
var (
InvalidFormat = NewError("invalid_format", "Invalid data format.")
)
var (
PathToOcsSignalingBackend = "ocs/v2.php/apps/spreed/api/v1/signaling/backend"
)
Functions ¶
func ContinentsOverlap ¶ added in v0.1.0
func GetEncodedSubject ¶ added in v0.1.0
The NATS client doesn't work if a subject contains spaces. As the room id can have an arbitrary format, we need to make sure the subject is valid. See "https://github.com/nats-io/nats.js/issues/158" for a similar report.
func GetGeoIpDownloadUrl ¶
func GetSubjectForBackendRoomId ¶ added in v0.1.0
func GetSubjectForRoomId ¶ added in v0.1.0
func GetSubjectForUserId ¶
func GetVirtualSessionId ¶ added in v0.2.0
func GetVirtualSessionId(session *ClientSession, sessionId string) string
func IsValidCountry ¶ added in v0.1.0
func LookupContinents ¶
func ValidateBackendChecksum ¶
Types ¶
type AddSessionInternalClientMessage ¶ added in v0.2.0
type AddSessionInternalClientMessage struct { CommonSessionInternalClientMessage UserId string `json:"userid,omitempty"` User *json.RawMessage `json:"user,omitempty"` Flags uint32 `json:"flags,omitempty"` Options *AddSessionOptions `json:"options,omitempy"` }
func (*AddSessionInternalClientMessage) CheckValid ¶ added in v0.2.0
func (m *AddSessionInternalClientMessage) CheckValid() error
type AddSessionOptions ¶ added in v0.2.0
type AnswerOfferMessage ¶
type BackendClient ¶
type BackendClient struct {
// contains filtered or unexported fields
}
func NewBackendClient ¶
func NewBackendClient(config *goconf.ConfigFile, maxConcurrentRequestsPerHost int, version string) (*BackendClient, error)
func (*BackendClient) GetBackend ¶ added in v0.1.0
func (b *BackendClient) GetBackend(u *url.URL) *Backend
func (*BackendClient) GetBackends ¶ added in v0.1.0
func (b *BackendClient) GetBackends() []*Backend
func (*BackendClient) GetCompatBackend ¶ added in v0.1.0
func (b *BackendClient) GetCompatBackend() *Backend
func (*BackendClient) IsUrlAllowed ¶
func (b *BackendClient) IsUrlAllowed(u *url.URL) bool
func (*BackendClient) PerformJSONRequest ¶
func (b *BackendClient) PerformJSONRequest(ctx context.Context, u *url.URL, request interface{}, response interface{}) error
PerformJSONRequest sends a JSON POST request to the given url and decodes the result into "response".
func (*BackendClient) Reload ¶ added in v0.2.0
func (b *BackendClient) Reload(config *goconf.ConfigFile)
type BackendClientAuthRequest ¶
type BackendClientAuthRequest struct { Version string `json:"version"` Params *json.RawMessage `json:"params"` }
type BackendClientAuthResponse ¶
type BackendClientAuthResponse struct { Version string `json:"version"` UserId string `json:"userid"` User *json.RawMessage `json:"user"` }
type BackendClientPingRequest ¶
type BackendClientPingRequest struct { Version string `json:"version"` RoomId string `json:"roomid"` Entries []BackendPingEntry `json:"entries"` }
type BackendClientRequest ¶
type BackendClientRequest struct { Type string `json:"type"` Auth *BackendClientAuthRequest `json:"auth,omitempty"` Room *BackendClientRoomRequest `json:"room,omitempty"` Ping *BackendClientPingRequest `json:"ping,omitempty"` Session *BackendClientSessionRequest `json:"session,omitempty"` }
func NewBackendClientAuthRequest ¶
func NewBackendClientAuthRequest(params *json.RawMessage) *BackendClientRequest
func NewBackendClientPingRequest ¶
func NewBackendClientPingRequest(roomid string, entries []BackendPingEntry) *BackendClientRequest
func NewBackendClientRoomRequest ¶
func NewBackendClientRoomRequest(roomid string, userid string, sessionid string) *BackendClientRequest
func NewBackendClientSessionRequest ¶ added in v0.2.0
func NewBackendClientSessionRequest(roomid string, action string, sessionid string, msg *AddSessionInternalClientMessage) *BackendClientRequest
type BackendClientResponse ¶
type BackendClientResponse struct { Type string `json:"type"` Error *Error `json:"error,omitempty"` Auth *BackendClientAuthResponse `json:"auth,omitempty"` Room *BackendClientRoomResponse `json:"room,omitempty"` Ping *BackendClientRingResponse `json:"ping,omitempty"` Session *BackendClientSessionResponse `json:"session,omitempty"` }
type BackendClientRoomRequest ¶
type BackendClientRoomRequest struct { Version string `json:"version"` RoomId string `json:"roomid"` Action string `json:"action,omitempty"` UserId string `json:"userid"` SessionId string `json:"sessionid"` // For Nextcloud Talk with SIP support. ActorId string `json:"actorid,omitempty"` ActorType string `json:"actortype,omitempty"` InCall int `json:"incall,omitempty"` }
type BackendClientRoomResponse ¶
type BackendClientRoomResponse struct { Version string `json:"version"` RoomId string `json:"roomid"` Properties *json.RawMessage `json:"properties"` // Optional information about the Nextcloud Talk session. Can be used for // example to define a "userid" for otherwise anonymous users. // See "RoomSessionData" for a possible content. Session *json.RawMessage `json:"session,omitempty"` Permissions *[]Permission `json:"permissions,omitempty"` }
type BackendClientSessionRequest ¶ added in v0.2.0
type BackendClientSessionResponse ¶ added in v0.2.0
type BackendConfiguration ¶ added in v0.1.0
type BackendConfiguration struct {
// contains filtered or unexported fields
}
func NewBackendConfiguration ¶ added in v0.1.0
func NewBackendConfiguration(config *goconf.ConfigFile) (*BackendConfiguration, error)
func (*BackendConfiguration) GetBackend ¶ added in v0.1.0
func (b *BackendConfiguration) GetBackend(u *url.URL) *Backend
func (*BackendConfiguration) GetBackends ¶ added in v0.1.0
func (b *BackendConfiguration) GetBackends() []*Backend
func (*BackendConfiguration) GetCompatBackend ¶ added in v0.1.0
func (b *BackendConfiguration) GetCompatBackend() *Backend
func (*BackendConfiguration) GetSecret ¶ added in v0.1.0
func (b *BackendConfiguration) GetSecret(u *url.URL) []byte
func (*BackendConfiguration) IsUrlAllowed ¶ added in v0.1.0
func (b *BackendConfiguration) IsUrlAllowed(u *url.URL) bool
func (*BackendConfiguration) Reload ¶ added in v0.2.0
func (b *BackendConfiguration) Reload(config *goconf.ConfigFile)
func (*BackendConfiguration) RemoveBackendsForHost ¶ added in v0.2.0
func (b *BackendConfiguration) RemoveBackendsForHost(host string)
func (*BackendConfiguration) UpsertHost ¶ added in v0.2.0
func (b *BackendConfiguration) UpsertHost(host string, backends []*Backend)
type BackendPingEntry ¶
type BackendRoomDeleteRequest ¶
type BackendRoomDeleteRequest struct {
UserIds []string `json:"userids,omitempty"`
}
type BackendRoomDisinviteRequest ¶
type BackendRoomDisinviteRequest struct { UserIds []string `json:"userids,omitempty"` SessionIds []string `json:"sessionids,omitempty"` // TODO(jojo): We should get rid of "AllUserIds" and find a better way to // notify existing users the room has changed and they need to update it. AllUserIds []string `json:"alluserids,omitempty"` Properties *json.RawMessage `json:"properties,omitempty"` }
type BackendRoomInCallRequest ¶
type BackendRoomInCallRequest struct { // TODO(jojo): Change "InCall" to "int" when #914 has landed in NC Talk. InCall json.RawMessage `json:"incall,omitempty"` Changed []map[string]interface{} `json:"changed,omitempty"` Users []map[string]interface{} `json:"users,omitempty"` }
type BackendRoomInviteRequest ¶
type BackendRoomInviteRequest struct { UserIds []string `json:"userids,omitempty"` // TODO(jojo): We should get rid of "AllUserIds" and find a better way to // notify existing users the room has changed and they need to update it. AllUserIds []string `json:"alluserids,omitempty"` Properties *json.RawMessage `json:"properties,omitempty"` }
type BackendRoomMessageRequest ¶
type BackendRoomMessageRequest struct {
Data *json.RawMessage `json:"data,omitempty"`
}
type BackendRoomUpdateRequest ¶
type BackendRoomUpdateRequest struct { UserIds []string `json:"userids,omitempty"` Properties *json.RawMessage `json:"properties,omitempty"` }
type BackendServer ¶
type BackendServer struct {
// contains filtered or unexported fields
}
func NewBackendServer ¶
func NewBackendServer(config *goconf.ConfigFile, hub *Hub, version string) (*BackendServer, error)
type BackendServerRoomRequest ¶
type BackendServerRoomRequest struct { Type string `json:"type"` Invite *BackendRoomInviteRequest `json:"invite,omitempty"` Disinvite *BackendRoomDisinviteRequest `json:"disinvite,omitempty"` Update *BackendRoomUpdateRequest `json:"update,omitempty"` Delete *BackendRoomDeleteRequest `json:"delete,omitempty"` InCall *BackendRoomInCallRequest `json:"incall,omitempty"` Participants *BackendRoomParticipantsRequest `json:"participants,omitempty"` Message *BackendRoomMessageRequest `json:"message,omitempty"` // Internal properties ReceivedTime int64 `json:"received,omitempty"` // contains filtered or unexported fields }
type BuiltinRoomSessions ¶
type BuiltinRoomSessions struct {
// contains filtered or unexported fields
}
func (*BuiltinRoomSessions) DeleteRoomSession ¶
func (r *BuiltinRoomSessions) DeleteRoomSession(session Session)
func (*BuiltinRoomSessions) GetSessionId ¶
func (r *BuiltinRoomSessions) GetSessionId(roomSessionId string) (string, error)
func (*BuiltinRoomSessions) SetRoomSession ¶
func (r *BuiltinRoomSessions) SetRoomSession(session Session, roomSessionId string) error
type ByeClientMessage ¶
type ByeClientMessage struct { }
func (*ByeClientMessage) CheckValid ¶
func (m *ByeClientMessage) CheckValid() error
type ByeProxyClientMessage ¶ added in v0.1.0
type ByeProxyClientMessage struct { }
func (*ByeProxyClientMessage) CheckValid ¶ added in v0.1.0
func (m *ByeProxyClientMessage) CheckValid() error
type ByeProxyServerMessage ¶ added in v0.1.0
type ByeProxyServerMessage struct {
Reason string `json:"reason"`
}
type ByeServerMessage ¶
type ByeServerMessage struct {
Reason string `json:"reason"`
}
type Client ¶
type Client struct { OnLookupCountry func(*Client) string OnClosed func(*Client) OnMessageReceived func(*Client, []byte) OnRTTReceived func(*Client, time.Duration) // contains filtered or unexported fields }
func (*Client) GetSession ¶
func (c *Client) GetSession() *ClientSession
func (*Client) IsAuthenticated ¶
func (*Client) IsConnected ¶
func (*Client) RemoteAddr ¶
func (*Client) SendByeResponse ¶
func (c *Client) SendByeResponse(message *ClientMessage) bool
func (*Client) SendByeResponseWithReason ¶
func (c *Client) SendByeResponseWithReason(message *ClientMessage, reason string) bool
func (*Client) SendMessage ¶
func (c *Client) SendMessage(message WritableClientMessage) bool
func (*Client) SetSession ¶
func (c *Client) SetSession(session *ClientSession)
type ClientMessage ¶
type ClientMessage struct { // The unique request id (optional). Id string `json:"id,omitempty"` // The type of the request. Type string `json:"type"` // Filled for type "hello" Hello *HelloClientMessage `json:"hello,omitempty"` Bye *ByeClientMessage `json:"bye,omitempty"` Room *RoomClientMessage `json:"room,omitempty"` Message *MessageClientMessage `json:"message,omitempty"` Control *ControlClientMessage `json:"control,omitempty"` Internal *InternalClientMessage `json:"internal,omitempty"` }
ClientMessage is a message that is sent from a client to the server.
func (*ClientMessage) CheckValid ¶
func (m *ClientMessage) CheckValid() error
func (*ClientMessage) NewErrorServerMessage ¶
func (m *ClientMessage) NewErrorServerMessage(e *Error) *ServerMessage
func (*ClientMessage) NewWrappedErrorServerMessage ¶
func (m *ClientMessage) NewWrappedErrorServerMessage(e error) *ServerMessage
type ClientSession ¶
type ClientSession struct {
// contains filtered or unexported fields
}
func NewClientSession ¶
func NewClientSession(hub *Hub, privateId string, publicId string, data *SessionIdData, backend *Backend, hello *HelloClientMessage, auth *BackendClientAuthResponse) (*ClientSession, error)
func (*ClientSession) AddVirtualSession ¶ added in v0.2.0
func (s *ClientSession) AddVirtualSession(session *VirtualSession)
func (*ClientSession) Backend ¶ added in v0.1.0
func (s *ClientSession) Backend() *Backend
func (*ClientSession) BackendUrl ¶
func (s *ClientSession) BackendUrl() string
func (*ClientSession) ClearClient ¶
func (s *ClientSession) ClearClient(client *Client)
func (*ClientSession) ClientType ¶
func (s *ClientSession) ClientType() string
func (*ClientSession) Close ¶
func (s *ClientSession) Close()
func (*ClientSession) Data ¶
func (s *ClientSession) Data() *SessionIdData
func (*ClientSession) GetClient ¶
func (s *ClientSession) GetClient() *Client
func (*ClientSession) GetFeatures ¶
func (s *ClientSession) GetFeatures() []string
func (*ClientSession) GetOrCreatePublisher ¶
func (s *ClientSession) GetOrCreatePublisher(ctx context.Context, mcu Mcu, streamType string) (McuPublisher, error)
func (*ClientSession) GetOrCreateSubscriber ¶
func (s *ClientSession) GetOrCreateSubscriber(ctx context.Context, mcu Mcu, id string, streamType string) (McuSubscriber, error)
func (*ClientSession) GetPublisher ¶
func (s *ClientSession) GetPublisher(streamType string) McuPublisher
func (*ClientSession) GetRoom ¶
func (s *ClientSession) GetRoom() *Room
func (*ClientSession) GetSubscriber ¶
func (s *ClientSession) GetSubscriber(id string, streamType string) McuSubscriber
func (*ClientSession) HasFeature ¶
func (s *ClientSession) HasFeature(feature string) bool
func (*ClientSession) HasPermission ¶
func (s *ClientSession) HasPermission(permission Permission) bool
func (*ClientSession) LeaveCall ¶
func (s *ClientSession) LeaveCall()
func (*ClientSession) LeaveRoom ¶
func (s *ClientSession) LeaveRoom(notify bool) *Room
func (*ClientSession) NotifySessionResumed ¶
func (s *ClientSession) NotifySessionResumed(client *Client)
func (*ClientSession) OnIceCandidate ¶
func (s *ClientSession) OnIceCandidate(client McuClient, candidate interface{})
func (*ClientSession) OnIceCompleted ¶
func (s *ClientSession) OnIceCompleted(client McuClient)
func (*ClientSession) ParsedBackendUrl ¶
func (s *ClientSession) ParsedBackendUrl() *url.URL
func (*ClientSession) PrivateId ¶
func (s *ClientSession) PrivateId() string
func (*ClientSession) PublicId ¶
func (s *ClientSession) PublicId() string
func (*ClientSession) PublisherClosed ¶
func (s *ClientSession) PublisherClosed(publisher McuPublisher)
func (*ClientSession) RemoveVirtualSession ¶ added in v0.2.0
func (s *ClientSession) RemoveVirtualSession(session *VirtualSession)
func (*ClientSession) RoomSessionId ¶
func (s *ClientSession) RoomSessionId() string
func (*ClientSession) SendMessage ¶ added in v0.2.0
func (s *ClientSession) SendMessage(message *ServerMessage) bool
func (*ClientSession) SendMessages ¶ added in v0.2.0
func (s *ClientSession) SendMessages(messages []*ServerMessage) bool
func (*ClientSession) SetClient ¶
func (s *ClientSession) SetClient(client *Client) *Client
func (*ClientSession) SetPermissions ¶
func (s *ClientSession) SetPermissions(permissions []Permission)
func (*ClientSession) SetRoom ¶
func (s *ClientSession) SetRoom(room *Room)
func (*ClientSession) StartExpire ¶
func (s *ClientSession) StartExpire()
func (*ClientSession) StopExpire ¶
func (s *ClientSession) StopExpire()
func (*ClientSession) SubscribeNats ¶
func (s *ClientSession) SubscribeNats(n NatsClient) error
func (*ClientSession) SubscribeRoomNats ¶
func (s *ClientSession) SubscribeRoomNats(n NatsClient, roomid string, roomSessionId string) error
func (*ClientSession) SubscriberClosed ¶
func (s *ClientSession) SubscriberClosed(subscriber McuSubscriber)
func (*ClientSession) UnsubscribeRoomNats ¶
func (s *ClientSession) UnsubscribeRoomNats()
func (*ClientSession) UserData ¶
func (s *ClientSession) UserData() *json.RawMessage
func (*ClientSession) UserId ¶
func (s *ClientSession) UserId() string
type ClientTypeInternalAuthParams ¶
type ClientTypeInternalAuthParams struct { Random string `json:"random"` Token string `json:"token"` Backend string `json:"backend"` // contains filtered or unexported fields }
func (*ClientTypeInternalAuthParams) CheckValid ¶ added in v0.1.0
func (p *ClientTypeInternalAuthParams) CheckValid() error
type CommandProxyClientMessage ¶ added in v0.1.0
type CommandProxyClientMessage struct { Type string `json:"type"` StreamType string `json:"streamType,omitempty"` PublisherId string `json:"publisherId,omitempty"` ClientId string `json:"clientId,omitempty"` }
func (*CommandProxyClientMessage) CheckValid ¶ added in v0.1.0
func (m *CommandProxyClientMessage) CheckValid() error
type CommandProxyServerMessage ¶ added in v0.1.0
type CommandProxyServerMessage struct {
Id string `json:"id,omitempty"`
}
type CommonSessionInternalClientMessage ¶ added in v0.2.0
type CommonSessionInternalClientMessage struct { SessionId string `json:"sessionid"` RoomId string `json:"roomid"` }
func (*CommonSessionInternalClientMessage) CheckValid ¶ added in v0.2.0
func (m *CommonSessionInternalClientMessage) CheckValid() error
type ConcurrentStringStringMap ¶
func (*ConcurrentStringStringMap) Clear ¶
func (m *ConcurrentStringStringMap) Clear()
func (*ConcurrentStringStringMap) Del ¶
func (m *ConcurrentStringStringMap) Del(key string)
func (*ConcurrentStringStringMap) Get ¶
func (m *ConcurrentStringStringMap) Get(key string) (string, bool)
func (*ConcurrentStringStringMap) Len ¶
func (m *ConcurrentStringStringMap) Len() int
func (*ConcurrentStringStringMap) Set ¶
func (m *ConcurrentStringStringMap) Set(key, value string)
type ControlClientMessage ¶
type ControlClientMessage struct {
MessageClientMessage
}
func (*ControlClientMessage) CheckValid ¶ added in v0.2.0
func (m *ControlClientMessage) CheckValid() error
type ControlServerMessage ¶
type ControlServerMessage struct { Sender *MessageServerMessageSender `json:"sender"` Recipient *MessageClientMessageRecipient `json:"recipient,omitempty"` Data *json.RawMessage `json:"data"` }
type DeferredExecutor ¶
type DeferredExecutor struct {
// contains filtered or unexported fields
}
DeferredExecutor will asynchronously execute functions while maintaining their order.
func NewDeferredExecutor ¶
func NewDeferredExecutor(queueSize int) *DeferredExecutor
func (*DeferredExecutor) Close ¶
func (e *DeferredExecutor) Close()
func (*DeferredExecutor) Execute ¶
func (e *DeferredExecutor) Execute(f func())
type Error ¶
type Error struct { Code string `json:"code"` Message string `json:"message"` Details interface{} `json:"details,omitempty"` }
func NewErrorDetail ¶
type EventProxyServerMessage ¶ added in v0.1.0
type EventServerMessage ¶
type EventServerMessage struct { Target string `json:"target"` Type string `json:"type"` // Used for target "room" Join []*EventServerMessageSessionEntry `json:"join,omitempty"` Leave []string `json:"leave,omitempty"` Change []*EventServerMessageSessionEntry `json:"change,omitempty"` // Used for target "roomlist" / "participants" Invite *RoomEventServerMessage `json:"invite,omitempty"` Disinvite *RoomDisinviteEventServerMessage `json:"disinvite,omitempty"` Update *RoomEventServerMessage `json:"update,omitempty"` Flags *RoomFlagsServerMessage `json:"flags,omitempty"` // Used for target "message" Message *RoomEventMessage `json:"message,omitempty"` }
type EventServerMessageSessionEntry ¶
type EventServerMessageSessionEntry struct { SessionId string `json:"sessionid"` UserId string `json:"userid"` User *json.RawMessage `json:"user,omitempty"` }
type GatewayListener ¶
type GatewayListener interface {
ConnectionInterrupted()
}
type GeoLookup ¶
type GeoLookup struct {
// contains filtered or unexported fields
}
func NewGeoLookupFromFile ¶ added in v0.1.0
func NewGeoLookupFromUrl ¶ added in v0.1.0
type HelloClientMessage ¶
type HelloClientMessage struct { Version string `json:"version"` ResumeId string `json:"resumeid"` Features []string `json:"features,omitempty"` // The authentication credentials. Auth HelloClientMessageAuth `json:"auth"` }
func (*HelloClientMessage) CheckValid ¶
func (m *HelloClientMessage) CheckValid() error
type HelloClientMessageAuth ¶
type HelloClientMessageAuth struct { // The client type that is connecting. Leave empty to use the default // "HelloClientTypeClient" Type string `json:"type,omitempty"` Params *json.RawMessage `json:"params"` Url string `json:"url"` // contains filtered or unexported fields }
type HelloProxyClientMessage ¶ added in v0.1.0
type HelloProxyClientMessage struct { Version string `json:"version"` ResumeId string `json:"resumeid"` Features []string `json:"features,omitempty"` // The authentication credentials. Token string `json:"token"` }
func (*HelloProxyClientMessage) CheckValid ¶ added in v0.1.0
func (m *HelloProxyClientMessage) CheckValid() error
type HelloProxyServerMessage ¶ added in v0.1.0
type HelloProxyServerMessage struct { Version string `json:"version"` SessionId string `json:"sessionid"` Server *HelloServerMessageServer `json:"server,omitempty"` }
type HelloServerMessage ¶
type HelloServerMessage struct { Version string `json:"version"` SessionId string `json:"sessionid"` ResumeId string `json:"resumeid"` UserId string `json:"userid"` Server *HelloServerMessageServer `json:"server,omitempty"` }
type HttpClientPool ¶
type HttpClientPool struct {
// contains filtered or unexported fields
}
func NewHttpClientPool ¶
func NewHttpClientPool(constructor func() *http.Client, size int) (*HttpClientPool, error)
func (*HttpClientPool) Put ¶
func (p *HttpClientPool) Put(c *http.Client)
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
func NewHub ¶
func NewHub(config *goconf.ConfigFile, nats NatsClient, r *mux.Router, version string) (*Hub, error)
func (*Hub) GetServerInfo ¶
func (h *Hub) GetServerInfo(session Session) *HelloServerMessageServer
func (*Hub) GetSessionByPublicId ¶
func (*Hub) Reload ¶ added in v0.1.0
func (h *Hub) Reload(config *goconf.ConfigFile)
type InfoMsg ¶
type InfoMsg struct { Name string Version int VersionString string `json:"version_string"` Author string DataChannels bool `json:"data_channels"` IPv6 bool `json:"ipv6"` LocalIP string `json:"local-ip"` ICE_TCP bool `json:"ice-tcp"` FullTrickle bool `json:"full-trickle"` Transports map[string]janus.PluginInfo Plugins map[string]janus.PluginInfo }
type InternalClientMessage ¶ added in v0.2.0
type InternalClientMessage struct { Type string `json:"type"` AddSession *AddSessionInternalClientMessage `json:"addsession,omitempty"` UpdateSession *UpdateSessionInternalClientMessage `json:"updatesession,omitempty"` RemoveSession *RemoveSessionInternalClientMessage `json:"removesession,omitempty"` }
func (*InternalClientMessage) CheckValid ¶ added in v0.2.0
func (m *InternalClientMessage) CheckValid() error
type JanusGateway ¶
type JanusGateway struct { // Sessions is a map of the currently active sessions to the gateway. Sessions map[uint64]*JanusSession // Access to the Sessions map should be synchronized with the Gateway.Lock() // and Gateway.Unlock() methods provided by the embedded sync.Mutex. sync.Mutex // contains filtered or unexported fields }
Gateway represents a connection to an instance of the Janus Gateway.
func NewJanusGateway ¶
func NewJanusGateway(wsURL string, listener GatewayListener) (*JanusGateway, error)
func (*JanusGateway) Close ¶
func (gateway *JanusGateway) Close() error
Close closes the underlying connection to the Gateway.
func (*JanusGateway) Create ¶
func (gateway *JanusGateway) Create(ctx context.Context) (*JanusSession, error)
Create sends a create request to the Gateway. On success, a new Session will be returned and error will be nil.
type JanusHandle ¶
type JanusHandle struct { // Id is the handle_id of this plugin handle Id uint64 // Type // pub or sub Type string //User // Userid User string // Events is a receive only channel that can be used to receive events // related to this handle from the gateway. Events chan interface{} // contains filtered or unexported fields }
Handle represents a handle to a plugin instance on the Gateway.
func (*JanusHandle) Detach ¶
func (handle *JanusHandle) Detach(ctx context.Context) (*janus.AckMsg, error)
Detach sends a detach request to the Gateway to remove this handle. On success, an AckMsg will be returned and error will be nil.
func (*JanusHandle) Message ¶
func (handle *JanusHandle) Message(ctx context.Context, body, jsep interface{}) (*janus.EventMsg, error)
Message sends a message request to a plugin handle on the Gateway. body should be the plugin data to be passed to the plugin, and jsep should contain an optional SDP offer/answer to establish a WebRTC PeerConnection. On success, an EventMsg will be returned and error will be nil.
func (*JanusHandle) Request ¶
func (handle *JanusHandle) Request(ctx context.Context, body interface{}) (*janus.SuccessMsg, error)
send sync request
func (*JanusHandle) Trickle ¶
func (handle *JanusHandle) Trickle(ctx context.Context, candidate interface{}) (*janus.AckMsg, error)
Trickle sends a trickle request to the Gateway as part of establishing a new PeerConnection with a plugin. candidate should be a single ICE candidate, or a completed object to signify that all candidates have been sent:
{ "completed": true }
On success, an AckMsg will be returned and error will be nil.
func (*JanusHandle) TrickleMany ¶
func (handle *JanusHandle) TrickleMany(ctx context.Context, candidates interface{}) (*janus.AckMsg, error)
TrickleMany sends a trickle request to the Gateway as part of establishing a new PeerConnection with a plugin. candidates should be an array of ICE candidates. On success, an AckMsg will be returned and error will be nil.
type JanusSession ¶
type JanusSession struct { // Id is the session_id of this session Id uint64 // Handles is a map of plugin handles within this session Handles map[uint64]*JanusHandle // Access to the Handles map should be synchronized with the Session.Lock() // and Session.Unlock() methods provided by the embedded sync.Mutex. sync.Mutex // contains filtered or unexported fields }
Session represents a session instance on the Janus Gateway.
func (*JanusSession) Attach ¶
func (session *JanusSession) Attach(ctx context.Context, plugin string) (*JanusHandle, error)
Attach sends an attach request to the Gateway within this session. plugin should be the unique string of the plugin to attach to. On success, a new Handle will be returned and error will be nil.
func (*JanusSession) Destroy ¶
func (session *JanusSession) Destroy(ctx context.Context) (*janus.AckMsg, error)
Destroy sends a destroy request to the Gateway to tear down this session. On success, the Session will be removed from the Gateway.Sessions map, an AckMsg will be returned and error will be nil.
type LoopbackNatsClient ¶
type LoopbackNatsClient struct {
// contains filtered or unexported fields
}
func (*LoopbackNatsClient) Decode ¶
func (c *LoopbackNatsClient) Decode(msg *nats.Msg, v interface{}) error
func (*LoopbackNatsClient) Publish ¶
func (c *LoopbackNatsClient) Publish(subject string, message interface{}) error
func (*LoopbackNatsClient) PublishBackendServerRoomRequest ¶
func (c *LoopbackNatsClient) PublishBackendServerRoomRequest(subject string, message *BackendServerRoomRequest) error
func (*LoopbackNatsClient) PublishMessage ¶
func (c *LoopbackNatsClient) PublishMessage(subject string, message *ServerMessage) error
func (*LoopbackNatsClient) PublishNats ¶
func (c *LoopbackNatsClient) PublishNats(subject string, message *NatsMessage) error
func (*LoopbackNatsClient) Subscribe ¶
func (c *LoopbackNatsClient) Subscribe(subject string, ch chan *nats.Msg) (NatsSubscription, error)
type LruCache ¶
type LruCache struct {
// contains filtered or unexported fields
}
func NewLruCache ¶
func (*LruCache) RemoveOldest ¶
func (c *LruCache) RemoveOldest()
type Mcu ¶
type Mcu interface { Start() error Stop() Reload(config *goconf.ConfigFile) SetOnConnected(func()) SetOnDisconnected(func()) GetStats() interface{} NewPublisher(ctx context.Context, listener McuListener, id string, streamType string, initiator McuInitiator) (McuPublisher, error) NewSubscriber(ctx context.Context, listener McuListener, publisher string, streamType string) (McuSubscriber, error) }
func NewMcuJanus ¶
func NewMcuJanus(url string, config *goconf.ConfigFile, nats NatsClient) (Mcu, error)
func NewMcuProxy ¶ added in v0.1.0
func NewMcuProxy(config *goconf.ConfigFile) (Mcu, error)
type McuClient ¶
type McuClient interface { Id() string StreamType() string Close(ctx context.Context) SendMessage(ctx context.Context, message *MessageClientMessage, data *MessageClientMessageData, callback func(error, map[string]interface{})) }
type McuInitiator ¶ added in v0.1.0
type McuInitiator interface {
Country() string
}
type McuListener ¶
type McuListener interface { PublicId() string OnIceCandidate(client McuClient, candidate interface{}) OnIceCompleted(client McuClient) PublisherClosed(publisher McuPublisher) SubscriberClosed(subscriber McuSubscriber) }
type McuPublisher ¶
type McuPublisher interface { McuClient }
type McuSubscriber ¶
type MessageClientMessage ¶
type MessageClientMessage struct { Recipient MessageClientMessageRecipient `json:"recipient"` Data *json.RawMessage `json:"data"` }
func (*MessageClientMessage) CheckValid ¶
func (m *MessageClientMessage) CheckValid() error
type MessageServerMessage ¶
type MessageServerMessage struct { Sender *MessageServerMessageSender `json:"sender"` Recipient *MessageClientMessageRecipient `json:"recipient,omitempty"` Data *json.RawMessage `json:"data"` }
type MessageServerMessageData ¶
type MessageServerMessageData struct { Type string `json:"type"` Chat *MessageServerMessageDataChat `json:"chat,omitempty"` }
type MessageServerMessageDataChat ¶
type MessageServerMessageDataChat struct {
Refresh bool `json:"refresh"`
}
type NatsClient ¶
type NatsClient interface { Subscribe(subject string, ch chan *nats.Msg) (NatsSubscription, error) Request(subject string, data []byte, timeout time.Duration) (*nats.Msg, error) Publish(subject string, message interface{}) error PublishNats(subject string, message *NatsMessage) error PublishMessage(subject string, message *ServerMessage) error PublishBackendServerRoomRequest(subject string, message *BackendServerRoomRequest) error Decode(msg *nats.Msg, v interface{}) error }
func NewLoopbackNatsClient ¶
func NewLoopbackNatsClient() (NatsClient, error)
func NewNatsClient ¶
func NewNatsClient(url string) (NatsClient, error)
type NatsMessage ¶
type NatsMessage struct { Type string `json:"type"` Message *ServerMessage `json:"message,omitempty"` Room *BackendServerRoomRequest `json:"room,omitempty"` Permissions []Permission `json:"permissions,omitempty"` }
type NatsSubscription ¶
type NatsSubscription interface {
Unsubscribe() error
}
type OcsBody ¶
type OcsBody struct { Meta OcsMeta `json:"meta"` Data *json.RawMessage `json:"data"` }
type OcsResponse ¶
type OcsResponse struct {
Ocs *OcsBody `json:"ocs"`
}
type PayloadProxyClientMessage ¶ added in v0.1.0
type PayloadProxyClientMessage struct { Type string `json:"type"` ClientId string `json:"clientId"` Payload map[string]interface{} `json:"payload,omitempty"` }
func (*PayloadProxyClientMessage) CheckValid ¶ added in v0.1.0
func (m *PayloadProxyClientMessage) CheckValid() error
type PayloadProxyServerMessage ¶ added in v0.1.0
type Permission ¶
type Permission string
var ( PERMISSION_MAY_PUBLISH_MEDIA Permission = "publish-media" PERMISSION_MAY_PUBLISH_SCREEN Permission = "publish-screen" PERMISSION_MAY_CONTROL Permission = "control" )
type ProxyClientMessage ¶ added in v0.1.0
type ProxyClientMessage struct { // The unique request id (optional). Id string `json:"id,omitempty"` // The type of the request. Type string `json:"type"` // Filled for type "hello" Hello *HelloProxyClientMessage `json:"hello,omitempty"` Bye *ByeProxyClientMessage `json:"bye,omitempty"` Command *CommandProxyClientMessage `json:"command,omitempty"` Payload *PayloadProxyClientMessage `json:"payload,omitempty"` }
func (*ProxyClientMessage) CheckValid ¶ added in v0.1.0
func (m *ProxyClientMessage) CheckValid() error
func (*ProxyClientMessage) NewErrorServerMessage ¶ added in v0.1.0
func (m *ProxyClientMessage) NewErrorServerMessage(e *Error) *ProxyServerMessage
func (*ProxyClientMessage) NewWrappedErrorServerMessage ¶ added in v0.1.0
func (m *ProxyClientMessage) NewWrappedErrorServerMessage(e error) *ProxyServerMessage
type ProxyInformationEtcd ¶ added in v0.1.0
type ProxyInformationEtcd struct {
Address string `json:"address"`
}
func (*ProxyInformationEtcd) CheckValid ¶ added in v0.1.0
func (p *ProxyInformationEtcd) CheckValid() error
type ProxyServerMessage ¶ added in v0.1.0
type ProxyServerMessage struct { Id string `json:"id,omitempty"` Type string `json:"type"` Error *Error `json:"error,omitempty"` Hello *HelloProxyServerMessage `json:"hello,omitempty"` Bye *ByeProxyServerMessage `json:"bye,omitempty"` Command *CommandProxyServerMessage `json:"command,omitempty"` Payload *PayloadProxyServerMessage `json:"payload,omitempty"` Event *EventProxyServerMessage `json:"event,omitempty"` }
ProxyServerMessage is a message that is sent from the server to a client.
func (*ProxyServerMessage) CloseAfterSend ¶ added in v0.1.0
func (r *ProxyServerMessage) CloseAfterSend(session Session) bool
type RemoveSessionInternalClientMessage ¶ added in v0.2.0
type RemoveSessionInternalClientMessage struct { CommonSessionInternalClientMessage UserId string `json:"userid,omitempty"` }
func (*RemoveSessionInternalClientMessage) CheckValid ¶ added in v0.2.0
func (m *RemoveSessionInternalClientMessage) CheckValid() error
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
func NewRoom ¶
func NewRoom(roomId string, properties *json.RawMessage, hub *Hub, n NatsClient, backend *Backend) (*Room, error)
func (*Room) AddSession ¶
func (r *Room) AddSession(session Session, sessionData *json.RawMessage) []Session
func (*Room) HasSession ¶
func (*Room) NotifySessionChanged ¶ added in v0.2.0
func (*Room) NotifySessionResumed ¶
func (*Room) Properties ¶
func (r *Room) Properties() *json.RawMessage
func (*Room) PublishSessionJoined ¶
func (r *Room) PublishSessionJoined(session Session, sessionData *RoomSessionData)
func (*Room) PublishSessionLeft ¶
func (*Room) PublishUsersChanged ¶
func (*Room) PublishUsersInCallChanged ¶
func (*Room) RemoveSession ¶
Returns "true" if there are still clients in the room.
func (*Room) UpdateProperties ¶
func (r *Room) UpdateProperties(properties *json.RawMessage)
type RoomClientMessage ¶
type RoomClientMessage struct { RoomId string `json:"roomid"` SessionId string `json:"sessionid,omitempty"` }
func (*RoomClientMessage) CheckValid ¶
func (m *RoomClientMessage) CheckValid() error
type RoomDisinviteEventServerMessage ¶ added in v0.1.0
type RoomDisinviteEventServerMessage struct { RoomEventServerMessage Reason string `json:"reason"` }
type RoomEventMessage ¶
type RoomEventMessage struct { RoomId string `json:"roomid"` Data *json.RawMessage `json:"data,omitempty"` }
type RoomEventServerMessage ¶
type RoomEventServerMessage struct { RoomId string `json:"roomid"` Properties *json.RawMessage `json:"properties,omitempty"` // TODO(jojo): Change "InCall" to "int" when #914 has landed in NC Talk. InCall *json.RawMessage `json:"incall,omitempty"` Changed []map[string]interface{} `json:"changed,omitempty"` Users []map[string]interface{} `json:"users,omitempty"` }
type RoomFlagsServerMessage ¶ added in v0.2.0
type RoomServerMessage ¶
type RoomServerMessage struct { RoomId string `json:"roomid"` Properties *json.RawMessage `json:"properties,omitempty"` }
type RoomSessionData ¶
type RoomSessionData struct {
UserId string `json:"userid,omitempty"`
}
type RoomSessions ¶
type RoomSessions interface { SetRoomSession(session Session, roomSessionId string) error DeleteRoomSession(session Session) GetSessionId(roomSessionId string) (string, error) }
func NewBuiltinRoomSessions ¶
func NewBuiltinRoomSessions() (RoomSessions, error)
type ServerMessage ¶
type ServerMessage struct { Id string `json:"id,omitempty"` Type string `json:"type"` Error *Error `json:"error,omitempty"` Hello *HelloServerMessage `json:"hello,omitempty"` Bye *ByeServerMessage `json:"bye,omitempty"` Room *RoomServerMessage `json:"room,omitempty"` Message *MessageServerMessage `json:"message,omitempty"` Control *ControlServerMessage `json:"control,omitempty"` Event *EventServerMessage `json:"event,omitempty"` }
ServerMessage is a message that is sent from the server to a client.
func (*ServerMessage) CloseAfterSend ¶
func (r *ServerMessage) CloseAfterSend(session Session) bool
func (*ServerMessage) IsChatRefresh ¶
func (r *ServerMessage) IsChatRefresh() bool
func (*ServerMessage) IsParticipantsUpdate ¶
func (r *ServerMessage) IsParticipantsUpdate() bool
type Session ¶
type Session interface { PrivateId() string PublicId() string ClientType() string Data() *SessionIdData UserId() string UserData() *json.RawMessage Backend() *Backend BackendUrl() string ParsedBackendUrl() *url.URL SetRoom(room *Room) GetRoom() *Room LeaveRoom(notify bool) *Room IsExpired(now time.Time) bool Close() HasPermission(permission Permission) bool }
type TokenClaims ¶ added in v0.1.0
type TokenClaims struct {
jwt.StandardClaims
}
type TrickleMsg ¶
type TurnCredentials ¶
type TurnCredentials struct { Username string `json:"username"` Password string `json:"password"` TTL int64 `json:"ttl"` URIs []string `json:"uris"` }
See https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00
type UpdateSessionInternalClientMessage ¶ added in v0.2.0
type UpdateSessionInternalClientMessage struct { CommonSessionInternalClientMessage Flags *uint32 `json:"flags,omitempty"` }
func (*UpdateSessionInternalClientMessage) CheckValid ¶ added in v0.2.0
func (m *UpdateSessionInternalClientMessage) CheckValid() error
type VirtualSession ¶ added in v0.2.0
type VirtualSession struct {
// contains filtered or unexported fields
}
func NewVirtualSession ¶ added in v0.2.0
func NewVirtualSession(session *ClientSession, privateId string, publicId string, data *SessionIdData, msg *AddSessionInternalClientMessage) *VirtualSession
func (*VirtualSession) AddFlags ¶ added in v0.2.0
func (s *VirtualSession) AddFlags(flags uint32) bool
func (*VirtualSession) Backend ¶ added in v0.2.0
func (s *VirtualSession) Backend() *Backend
func (*VirtualSession) BackendUrl ¶ added in v0.2.0
func (s *VirtualSession) BackendUrl() string
func (*VirtualSession) ClientType ¶ added in v0.2.0
func (s *VirtualSession) ClientType() string
func (*VirtualSession) Close ¶ added in v0.2.0
func (s *VirtualSession) Close()
func (*VirtualSession) Data ¶ added in v0.2.0
func (s *VirtualSession) Data() *SessionIdData
func (*VirtualSession) Flags ¶ added in v0.2.0
func (s *VirtualSession) Flags() uint32
func (*VirtualSession) GetRoom ¶ added in v0.2.0
func (s *VirtualSession) GetRoom() *Room
func (*VirtualSession) HasPermission ¶ added in v0.2.0
func (s *VirtualSession) HasPermission(permission Permission) bool
func (*VirtualSession) IsExpired ¶ added in v0.2.0
func (s *VirtualSession) IsExpired(now time.Time) bool
func (*VirtualSession) LeaveRoom ¶ added in v0.2.0
func (s *VirtualSession) LeaveRoom(notify bool) *Room
func (*VirtualSession) Options ¶ added in v0.2.0
func (s *VirtualSession) Options() *AddSessionOptions
func (*VirtualSession) ParsedBackendUrl ¶ added in v0.2.0
func (s *VirtualSession) ParsedBackendUrl() *url.URL
func (*VirtualSession) PrivateId ¶ added in v0.2.0
func (s *VirtualSession) PrivateId() string
func (*VirtualSession) PublicId ¶ added in v0.2.0
func (s *VirtualSession) PublicId() string
func (*VirtualSession) RemoveFlags ¶ added in v0.2.0
func (s *VirtualSession) RemoveFlags(flags uint32) bool
func (*VirtualSession) Session ¶ added in v0.2.0
func (s *VirtualSession) Session() *ClientSession
func (*VirtualSession) SessionId ¶ added in v0.2.0
func (s *VirtualSession) SessionId() string
func (*VirtualSession) SetFlags ¶ added in v0.2.0
func (s *VirtualSession) SetFlags(flags uint32) bool
func (*VirtualSession) SetRoom ¶ added in v0.2.0
func (s *VirtualSession) SetRoom(room *Room)
func (*VirtualSession) UserData ¶ added in v0.2.0
func (s *VirtualSession) UserData() *json.RawMessage
func (*VirtualSession) UserId ¶ added in v0.2.0
func (s *VirtualSession) UserId() string
Source Files ¶
- api_backend.go
- api_proxy.go
- api_signaling.go
- backend_client.go
- backend_configuration.go
- backend_server.go
- client.go
- clientsession.go
- concurrentmap.go
- continentmap.go
- deferred_executor.go
- geoip.go
- hub.go
- janus_client.go
- lru.go
- mcu_common.go
- mcu_janus.go
- mcu_proxy.go
- natsclient.go
- natsclient_loopback.go
- pool.go
- room.go
- roomsessions.go
- roomsessions_builtin.go
- session.go
- virtualsession.go