aboutsummaryrefslogtreecommitdiff
path: root/src/diplonat.rs
blob: c209da5ba9fe8cdbe5d2364f1aa20822eba05af1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
}