skyway_webrtc_gateway_api/
lib.rs1pub mod common;
3pub mod data;
5pub mod error;
7pub(crate) mod helper;
9pub mod media;
11pub mod peer;
13pub mod prelude;
15
16use std::sync::Once;
17
18static mut BASE_URL: String = String::new();
19static INIT: Once = Once::new();
20static INIT_CHECK: Once = Once::new();
21
22pub fn initialize(base_url: impl Into<String>) {
24 unsafe {
25 INIT.call_once(|| {
26 BASE_URL = base_url.into();
27 });
28 }
29}
30
31pub(crate) fn base_url() -> &'static str {
33 unsafe {
34 INIT_CHECK.call_once(|| {
35 if BASE_URL.len() == 0 {
36 panic!("not initialized");
37 }
38 });
39 &BASE_URL
40 }
41}