Changeset View
Changeset View
Standalone View
Standalone View
services/tunnelbroker/src/main.rs
pub mod constants; | pub mod constants; | ||||
pub mod grpc; | pub mod grpc; | ||||
pub mod websockets; | pub mod websockets; | ||||
use dashmap::DashMap; | use dashmap::DashMap; | ||||
use once_cell::sync::Lazy; | use once_cell::sync::Lazy; | ||||
use std::io::{self, Error, ErrorKind}; | use std::io::{self, Error, ErrorKind}; | ||||
use tokio::sync::mpsc::UnboundedSender; | use tokio::sync::mpsc::UnboundedSender; | ||||
use tracing::{self, Level}; | use tracing::{self, Level}; | ||||
use tracing_subscriber::EnvFilter; | use tracing_subscriber::EnvFilter; | ||||
use tunnelbroker_messages::Messages; | |||||
pub static ACTIVE_CONNECTIONS: Lazy< | pub static ACTIVE_CONNECTIONS: Lazy<DashMap<String, UnboundedSender<String>>> = | ||||
DashMap<String, UnboundedSender<Messages>>, | Lazy::new(DashMap::new); | ||||
> = Lazy::new(DashMap::new); | |||||
#[tokio::main] | #[tokio::main] | ||||
async fn main() -> Result<(), io::Error> { | async fn main() -> Result<(), io::Error> { | ||||
let filter = EnvFilter::builder() | let filter = EnvFilter::builder() | ||||
.with_default_directive(Level::INFO.into()) | .with_default_directive(Level::INFO.into()) | ||||
.with_env_var(constants::LOG_LEVEL_ENV_VAR) | .with_env_var(constants::LOG_LEVEL_ENV_VAR) | ||||
.from_env_lossy(); | .from_env_lossy(); | ||||
Show All 16 Lines |