Skip to content

Commit

Permalink
Add get_turn_server_info
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Oct 19, 2024
1 parent 026d751 commit f810bdd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/push_service/calling.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use super::{HttpAuthOverride, PushService, ServiceError};
use crate::configuration::Endpoint;
use serde::Deserialize;

#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TurnServerInfo {
pub username: String,
pub password: String,
pub hostname: String,
pub urls: Vec<String>,
pub urls_with_ips: Vec<String>,
}

impl PushService {
pub async fn get_turn_server_info(
&mut self,
) -> Result<TurnServerInfo, ServiceError> {
self.get_json(

Check failure on line 19 in src/push_service/calling.rs

View workflow job for this annotation

GitHub Actions / clippy

no method named `get_json` found for mutable reference `&mut push_service::PushService` in the current scope

error[E0599]: no method named `get_json` found for mutable reference `&mut push_service::PushService` in the current scope --> src/push_service/calling.rs:19:14 | 19 | self.get_json( | -----^^^^^^^^ method not found in `&mut PushService`
Endpoint::Service,
"/v1/calling/relays",
&[],
HttpAuthOverride::NoOverride,
)
.await
}
}
2 changes: 2 additions & 0 deletions src/push_service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub const KEEPALIVE_TIMEOUT_SECONDS: Duration = Duration::from_secs(55);
pub const DEFAULT_DEVICE_ID: u32 = 1;

mod account;
mod calling;
mod cdn;
mod error;
mod keys;
Expand All @@ -46,6 +47,7 @@ mod registration;
mod stickers;

pub use account::*;
pub use calling::*;
pub use cdn::*;
pub use error::*;
pub use keys::*;
Expand Down

0 comments on commit f810bdd

Please sign in to comment.