-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use structopt for command line arguments #40
Conversation
It makes the library usage more flexible: with structopt flatten we can create CLI apps which can inherit configuration options from quic-p2p.
…atforms It is not supported on Android/iOS and embedded platforms so we don't need it. Also add placeholders for project_dir.
@@ -13,7 +13,7 @@ use crate::error::Error; | |||
use serde::de::DeserializeOwned; | |||
use serde::Serialize; | |||
use std::fs::File; | |||
use std::io::{self, BufReader, BufWriter}; | |||
use std::io::{BufReader, BufWriter}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not used on non-T1/mobile platforms (see the project_dir
impl below)
src/config.rs
Outdated
pub idle_timeout_msec: Option<u64>, | ||
/// Interval to send keep-alives if we are idling so that the peer does not disconnect from us | ||
/// declaring us offline. If none is supplied we'll default to the documented constant. | ||
/// | ||
/// The interval is in milliseconds. A value of 0 disables this feature. | ||
#[structopt(long)] | ||
pub keep_alive_interval_msec: Option<u32>, | ||
/// Path to our TLS Certificate. This file must contain `SerialisableCertificate` as content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is not correct - can we pls change it to say it's not a path we are asking but the certificate itself ?
Using this library gives us more flexibility in ways users can configure the options provided by the library.
This PR also includes some changes in
directories
/config file loader handling (e.g., it also takes mobile platforms into account).