medea/turn/
mod.rs

1//! [TURN] server managing implementation.
2//!
3//! [TURN]: https://webrtcglossary.com/turn
4
5pub mod allocation_event;
6pub mod cli;
7pub mod coturn_metrics;
8pub mod ice_user;
9pub mod repo;
10pub mod service;
11
12use derive_more::Display;
13use medea_client_api_proto::{PeerId, RoomId};
14
15#[doc(inline)]
16pub use self::{
17    ice_user::{IceUser, IceUsername},
18    service::{
19        new_turn_auth_service, TurnAuthService, TurnServiceErr,
20        UnreachablePolicy,
21    },
22};
23
24#[cfg(test)]
25pub use self::service::test::new_turn_auth_service_mock;
26
27/// Username of Coturn user.
28#[derive(Clone, Debug, Display, Eq, Hash, PartialEq)]
29#[display(fmt = "{}_{}", room_id, peer_id)]
30pub struct CoturnUsername {
31    /// [`RoomId`] of the Room this Coturn user is created for.
32    pub room_id: RoomId,
33
34    /// [`PeerId`] of the Peer this Coturn user is created for.
35    pub peer_id: PeerId,
36}