Reorder functions
This commit is contained in:
parent
fb2fc57715
commit
12a9965f10
1 changed files with 6 additions and 6 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -108,12 +108,6 @@ fn list_endpoints(opts: &Opts) -> Result<(), anyhow::Error> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn get_locations() -> Result<Locations, anyhow::Error> {
|
||||
let url = format!("{}/locations", BASE_URL);
|
||||
let locations: Locations = ureq::get(&url).call()?.into_json()?;
|
||||
Ok(locations)
|
||||
}
|
||||
|
||||
fn get_config(_opts: &Opts, config_opts: &ConfigOpts) -> Result<(), anyhow::Error> {
|
||||
let locations = get_locations()?;
|
||||
let location = locations
|
||||
|
|
@ -164,6 +158,12 @@ fn check(opts: &Opts) -> Result<(), anyhow::Error> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn get_locations() -> Result<Locations, anyhow::Error> {
|
||||
let url = format!("{}/locations", BASE_URL);
|
||||
let locations: Locations = ureq::get(&url).call()?.into_json()?;
|
||||
Ok(locations)
|
||||
}
|
||||
|
||||
fn generage_keys() -> Result<WireguardKeyPair, anyhow::Error> {
|
||||
let privkey = process::Command::new("wg").arg("genkey").output()?.stdout;
|
||||
let mut pubkey_cmd = process::Command::new("wg")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue