signaling

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2020 License: AGPL-3.0 Imports: 48 Imported by: 0

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/>.

*

*

  • 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

View Source
const (
	BackendVersion = "1.0"

	HeaderBackendSignalingRandom   = "Spreed-Signaling-Random"
	HeaderBackendSignalingChecksum = "Spreed-Signaling-Checksum"
	HeaderBackendServer            = "Spreed-Signaling-Backend"
)
View Source
const (
	HelloClientTypeClient   = "client"
	HelloClientTypeInternal = "internal"

	HelloClientTypeVirtual = "virtual"
)
View Source
const (
	// Features for all clients.
	ServerFeatureMcu = "mcu"

	// Features for internal clients only.
	ServerFeatureInternalVirtualSessions = "virtual-sessions"
)
View Source
const (
	RecipientTypeSession = "session"
	RecipientTypeUser    = "user"
	RecipientTypeRoom    = "room"
)
View Source
const (
	DisinviteReasonDisinvited = "disinvited"
	DisinviteReasonDeleted    = "deleted"
)
View Source
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
)
View Source
const (
	McuTypeJanus = "janus"
	McuTypeProxy = "proxy"

	McuTypeDefault = McuTypeJanus
)
View Source
const (
	// Must match values in "Participant.php" from Nextcloud Talk.
	FlagDisconnected = 0
	FlagInCall       = 1
	FlagWithAudio    = 2
	FlagWithVideo    = 4
	FlagWithPhone    = 8
)
View Source
const (
	FLAG_MUTED_SPEAKING  = 1
	FLAG_MUTED_LISTENING = 2
	FLAG_TALKING         = 4
)
View Source
const (
	// Version that must be sent in a "hello" message.
	HelloVersion = "1.0"
)

Variables

View Source
var (
	DefaultFeatures         []string
	DefaultFeaturesInternal []string = []string{
		ServerFeatureInternalVirtualSessions,
	}
)
View Source
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.")
)
View Source
var (
	ContinentMap map[string][]string = map[string][]string{}/* 254 elements not displayed */

)
View Source
var (
	ErrDatabaseNotInitialized = fmt.Errorf("GeoIP database not initialized yet")
)
View Source
var (
	ErrNoSuchRoomSession = fmt.Errorf("unknown room session id")
)
View Source
var (
	ErrNotConnected = fmt.Errorf("Not connected")
)
View Source
var (
	ErrUseLastResponse = fmt.Errorf("Use last response")
)
View Source
var (
	InvalidFormat = NewError("invalid_format", "Invalid data format.")
)
View Source
var (
	PathToOcsSignalingBackend = "ocs/v2.php/apps/spreed/api/v1/signaling/backend"
)

Functions

func AddBackendChecksum

func AddBackendChecksum(r *http.Request, body []byte, secret []byte)

func CalculateBackendChecksum

func CalculateBackendChecksum(random string, body []byte, secret []byte) string

func ContinentsOverlap added in v0.1.0

func ContinentsOverlap(a, b []string) bool

func GetEncodedSubject added in v0.1.0

func GetEncodedSubject(prefix string, suffix string) string

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 GetGeoIpDownloadUrl(license string) string

func GetSubjectForBackendRoomId added in v0.1.0

func GetSubjectForBackendRoomId(roomId string, backend *Backend) string

func GetSubjectForRoomId added in v0.1.0

func GetSubjectForRoomId(roomId string, backend *Backend) string

func GetSubjectForUserId

func GetSubjectForUserId(userId string, backend *Backend) string

func GetVirtualSessionId added in v0.2.0

func GetVirtualSessionId(session *ClientSession, sessionId string) string

func IsInCall

func IsInCall(value interface{}) (bool, bool)

func IsValidCountry added in v0.1.0

func IsValidCountry(country string) bool

func LookupContinents

func LookupContinents(country string) []string

func ValidateBackendChecksum

func ValidateBackendChecksum(r *http.Request, body []byte, secret []byte) bool

func ValidateBackendChecksumValue

func ValidateBackendChecksumValue(checksum string, random string, body []byte, secret []byte) bool

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 AddSessionOptions struct {
	ActorId   string `json:"actorId,omitempty"`
	ActorType string `json:"actorType,omitempty"`
}

type AnswerOfferMessage

type AnswerOfferMessage struct {
	To       string                 `json:"to"`
	From     string                 `json:"from"`
	Type     string                 `json:"type"`
	RoomType string                 `json:"roomType"`
	Payload  map[string]interface{} `json:"payload"`
}

type Backend added in v0.1.0

type Backend struct {
	// contains filtered or unexported fields
}

func (*Backend) Id added in v0.1.0

func (b *Backend) Id() string

func (*Backend) IsCompat added in v0.1.0

func (b *Backend) IsCompat() bool

func (*Backend) Secret added in v0.1.0

func (b *Backend) Secret() []byte

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 BackendClientRingResponse

type BackendClientRingResponse struct {
	Version string `json:"version"`
	RoomId  string `json:"roomid"`
}

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 BackendClientSessionRequest struct {
	Version   string           `json:"version"`
	RoomId    string           `json:"roomid"`
	Action    string           `json:"action"`
	SessionId string           `json:"sessionid"`
	UserId    string           `json:"userid,omitempty"`
	User      *json.RawMessage `json:"user,omitempty"`
}

type BackendClientSessionResponse added in v0.2.0

type BackendClientSessionResponse struct {
	Version string `json:"version"`
	RoomId  string `json:"roomid"`
}

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 BackendPingEntry struct {
	UserId    string `json:"userid,omitempty"`
	SessionId string `json:"sessionid"`
}

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 BackendRoomParticipantsRequest

type BackendRoomParticipantsRequest struct {
	Changed []map[string]interface{} `json:"changed,omitempty"`
	Users   []map[string]interface{} `json:"users,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)

func (*BackendServer) Start

func (b *BackendServer) Start(r *mux.Router) 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 NewClient

func NewClient(conn *websocket.Conn, remoteAddress string, agent string) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Country

func (c *Client) Country() string

func (*Client) GetSession

func (c *Client) GetSession() *ClientSession

func (*Client) IsAuthenticated

func (c *Client) IsAuthenticated() bool

func (*Client) IsConnected

func (c *Client) IsConnected() bool

func (*Client) ReadPump added in v0.1.0

func (c *Client) ReadPump()

func (*Client) RemoteAddr

func (c *Client) RemoteAddr() string

func (*Client) SendByeResponse

func (c *Client) SendByeResponse(message *ClientMessage) bool

func (*Client) SendByeResponseWithReason

func (c *Client) SendByeResponseWithReason(message *ClientMessage, reason string) bool

func (*Client) SendError

func (c *Client) SendError(e *Error) bool

func (*Client) SendMessage

func (c *Client) SendMessage(message WritableClientMessage) bool

func (*Client) SetConn added in v0.1.0

func (c *Client) SetConn(conn *websocket.Conn, remoteAddress string)

func (*Client) SetSession

func (c *Client) SetSession(session *ClientSession)

func (*Client) UserAgent

func (c *Client) UserAgent() string

func (*Client) WritePump added in v0.1.0

func (c *Client) WritePump()

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) IsExpired

func (s *ClientSession) IsExpired(now time.Time) 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

type ConcurrentStringStringMap struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*ConcurrentStringStringMap) Clear

func (m *ConcurrentStringStringMap) Clear()

func (*ConcurrentStringStringMap) Del

func (m *ConcurrentStringStringMap) Del(key string)

func (*ConcurrentStringStringMap) Get

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 NewError

func NewError(code string, message string) *Error

func NewErrorDetail

func NewErrorDetail(code string, message string, details interface{}) *Error

func (*Error) Error

func (e *Error) Error() string

type EventProxyServerMessage added in v0.1.0

type EventProxyServerMessage struct {
	Type string `json:"type"`

	ClientId string `json:"clientId,omitempty"`
	Load     int64  `json:"load,omitempty"`
}

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 NewGeoLookupFromFile(filename string) (*GeoLookup, error)

func NewGeoLookupFromUrl added in v0.1.0

func NewGeoLookupFromUrl(url string) (*GeoLookup, error)

func (*GeoLookup) Close

func (g *GeoLookup) Close()

func (*GeoLookup) LookupCountry

func (g *GeoLookup) LookupCountry(ip net.IP) (string, error)

func (*GeoLookup) Update

func (g *GeoLookup) Update() error

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 HelloServerMessageServer

type HelloServerMessageServer struct {
	Version  string   `json:"version"`
	Features []string `json:"features,omitempty"`
	Country  string   `json:"country,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) Get

func (p *HttpClientPool) Get(ctx context.Context) (client *http.Client, err 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 (h *Hub) GetSessionByPublicId(sessionId string) Session

func (*Hub) GetStats added in v0.1.0

func (h *Hub) GetStats() map[string]interface{}

func (*Hub) Reload added in v0.1.0

func (h *Hub) Reload(config *goconf.ConfigFile)

func (*Hub) Run

func (h *Hub) Run()

func (*Hub) SetMcu

func (h *Hub) SetMcu(mcu Mcu)

func (*Hub) Stop

func (h *Hub) Stop()

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.

func (*JanusGateway) Info

func (gateway *JanusGateway) Info(ctx context.Context) (*InfoMsg, error)

Info sends an info request to the Gateway. On success, an InfoMsg 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.

func (*JanusSession) KeepAlive

func (session *JanusSession) KeepAlive(ctx context.Context) (*janus.AckMsg, error)

KeepAlive sends a keep-alive request to the Gateway. On success, 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) Request

func (c *LoopbackNatsClient) Request(subject string, data []byte, timeout time.Duration) (*nats.Msg, 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 NewLruCache(size int) *LruCache

func (*LruCache) Get

func (c *LruCache) Get(key string) interface{}

func (*LruCache) Len

func (c *LruCache) Len() int

func (*LruCache) Remove

func (c *LruCache) Remove(key string)

func (*LruCache) RemoveOldest

func (c *LruCache) RemoveOldest()

func (*LruCache) Set

func (c *LruCache) Set(key string, value interface{})

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 McuSubscriber interface {
	McuClient

	Publisher() string
}

type MessageClientMessage

type MessageClientMessage struct {
	Recipient MessageClientMessageRecipient `json:"recipient"`

	Data *json.RawMessage `json:"data"`
}

func (*MessageClientMessage) CheckValid

func (m *MessageClientMessage) CheckValid() error

type MessageClientMessageData

type MessageClientMessageData struct {
	Type     string                 `json:"type"`
	Sid      string                 `json:"sid"`
	RoomType string                 `json:"roomType"`
	Payload  map[string]interface{} `json:"payload"`
}

type MessageClientMessageRecipient

type MessageClientMessageRecipient struct {
	Type string `json:"type"`

	SessionId string `json:"sessionid,omitempty"`
	UserId    string `json:"userid,omitempty"`
}

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 MessageServerMessageSender

type MessageServerMessageSender struct {
	Type string `json:"type"`

	SessionId string `json:"sessionid,omitempty"`
	UserId    string `json:"userid,omitempty"`
}

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 OcsMeta

type OcsMeta struct {
	Status     string `json:"status"`
	StatusCode int    `json:"statuscode"`
	Message    string `json:"message"`
}

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 PayloadProxyServerMessage struct {
	Type string `json:"type"`

	ClientId string                 `json:"clientId"`
	Payload  map[string]interface{} `json:"payload"`
}

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) Backend added in v0.1.0

func (r *Room) Backend() *Backend

func (*Room) Close

func (r *Room) Close() []Session

func (*Room) HasSession

func (r *Room) HasSession(session Session) bool

func (*Room) Id

func (r *Room) Id() string

func (*Room) NotifySessionChanged added in v0.2.0

func (r *Room) NotifySessionChanged(session Session)

func (*Room) NotifySessionResumed

func (r *Room) NotifySessionResumed(client *Client)

func (*Room) Properties

func (r *Room) Properties() *json.RawMessage

func (*Room) PublishSessionJoined

func (r *Room) PublishSessionJoined(session Session, sessionData *RoomSessionData)

func (*Room) PublishSessionLeft

func (r *Room) PublishSessionLeft(session Session)

func (*Room) PublishUsersChanged

func (r *Room) PublishUsersChanged(changed []map[string]interface{}, users []map[string]interface{})

func (*Room) PublishUsersInCallChanged

func (r *Room) PublishUsersInCallChanged(changed []map[string]interface{}, users []map[string]interface{})

func (*Room) RemoveSession

func (r *Room) RemoveSession(session Session) bool

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 RoomFlagsServerMessage struct {
	RoomId    string `json:"roomid"`
	SessionId string `json:"sessionid"`
	Flags     uint32 `json:"flags"`
}

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 SessionIdData

type SessionIdData struct {
	Sid       uint64
	Created   time.Time
	BackendId string
}

type TokenClaims added in v0.1.0

type TokenClaims struct {
	jwt.StandardClaims
}

type TrickleMsg

type TrickleMsg struct {
	Session   uint64 `json:"session_id"`
	Handle    uint64 `json:"sender"`
	Candidate struct {
		SdpMid        string `json:"sdpMid"`
		SdpMLineIndex int    `json:"sdpMLineIndex"`
		Candidate     string `json:"candidate"`

		Completed bool `json:"completed,omitempty"`
	} `json:"candidate"`
}

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

type WritableClientMessage added in v0.1.0

type WritableClientMessage interface {
	json.Marshaler

	CloseAfterSend(session Session) bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL