shrupl/src/main.rs

31 lines
630 B
Rust
Raw Normal View History

2025-05-22 17:34:44 +00:00
mod sharry;
use log::info;
use sharry::{
Alias,
2025-05-22 21:07:49 +00:00
api::{NewShareRequest, URI},
2025-05-22 17:34:44 +00:00
};
use std::time::Duration;
use ureq::Agent;
2025-05-17 23:57:52 +00:00
fn main() {
2025-05-22 17:34:44 +00:00
env_logger::init();
let agent: Agent = Agent::config_builder()
.timeout_global(Some(Duration::from_secs(5)))
.build()
.into();
2025-05-22 21:07:49 +00:00
let alias = Alias::new(
URI::new("sharry.yavook.de"),
"G7RYoWME1W7-pcgipemJcr8-39FcMd92gBu-RgufeHc51z6",
);
2025-05-22 17:34:44 +00:00
let share = alias.create_share(&agent, &NewShareRequest::new(Some("foo"), "", 10));
2025-05-22 21:07:49 +00:00
let share = share.unwrap();
info!("share: {:?}", share);
share.notify(&agent).unwrap();
2025-05-17 23:57:52 +00:00
}