#[macro_export]
macro_rules! get {
($handler:expr, $req:expr) => {
$handler.client.execute($req.build()?).await?.error_for_status()
}
}
pub struct Core {
pub host: String,
pub token: String,
pub client: reqwest::Client,
}
impl Core {
pub fn new(host: String, token: String) -> Self {
let client = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.expect("failed to build client");
Core { host, token, client }
}
}