2020-05-09 13:53:22 +00:00
|
|
|
use igd::Gateway;
|
2020-05-09 14:19:09 +00:00
|
|
|
use anyhow::{Result, Context};
|
2020-05-09 13:53:22 +00:00
|
|
|
|
|
|
|
use crate::*;
|
|
|
|
|
|
|
|
pub struct DiplonatContext {
|
|
|
|
pub config: config::DiplonatConfig,
|
|
|
|
//pub gateway: igd::Gateway
|
|
|
|
}
|
|
|
|
|
2020-05-09 14:04:06 +00:00
|
|
|
pub fn setup() -> Result<DiplonatContext> {
|
2020-05-09 13:53:22 +00:00
|
|
|
return Ok(DiplonatContext {
|
2020-05-09 14:19:09 +00:00
|
|
|
config: config::load_env().context("Unable to read configuration from environment")?,
|
2020-05-09 13:53:22 +00:00
|
|
|
//gateway: search_gateway(Default::default()).await
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-05-09 14:19:09 +00:00
|
|
|
pub fn listen() -> bool {
|
2020-05-09 13:53:22 +00:00
|
|
|
return true;
|
|
|
|
}
|