28 lines
672 B
Rust
28 lines
672 B
Rust
mod sharry;
|
|
|
|
use log::info;
|
|
use sharry::{Alias, NewShareRequest, Share};
|
|
use std::time::Duration;
|
|
use ureq::Agent;
|
|
|
|
fn main() {
|
|
env_logger::init();
|
|
|
|
let agent: Agent = Agent::config_builder()
|
|
.timeout_global(Some(Duration::from_secs(5)))
|
|
.build()
|
|
.into();
|
|
|
|
let alias = Alias::new(
|
|
"sharry.yavook.de".into(),
|
|
"G7RYoWME1W7-pcgipemJcr8-39FcMd92gBu-RgufeHc51z6",
|
|
);
|
|
|
|
let share = NewShareRequest::new(Some("foo"), "", 10);
|
|
let share = Share::create(&agent, &alias, share).unwrap();
|
|
info!("share: {:?}", share);
|
|
|
|
// share.create_file(&agent, "./myfile.dat").unwrap();
|
|
|
|
share.notify(&agent).unwrap();
|
|
}
|