aboutsummaryrefslogblamecommitdiff
path: root/src/diplonat.rs
blob: c209da5ba9fe8cdbe5d2364f1aa20822eba05af1 (plain) (tree)
1
2
3
4
5
6
7
8
9
                              
           



                                     
                                

 

                                                 
                                                                                         



                                      

 
                         

              
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;
}