forked from Deuxfleurs/diplonat
22 lines
440 B
Rust
22 lines
440 B
Rust
use anyhow::{Result, Context};
|
|
use log::*;
|
|
use crate::*;
|
|
|
|
pub struct DiplonatContext {
|
|
pub config: config::DiplonatConfig,
|
|
pub gateway: igd::aio::Gateway
|
|
}
|
|
|
|
pub async fn setup() -> Result<DiplonatContext> {
|
|
let ctx = DiplonatContext {
|
|
config: config::load_env().context("Unable to read configuration from environment")?,
|
|
gateway: gw::get_gateway().await?
|
|
};
|
|
|
|
return Ok(ctx);
|
|
}
|
|
|
|
pub fn listen() -> bool {
|
|
return true;
|
|
}
|