Mod Management API (#81)

* Profile mod management

* remove print statement
This commit is contained in:
Geometrically
2023-04-13 12:03:15 -07:00
committed by GitHub
parent bb126c0545
commit f8173d3b78
22 changed files with 616 additions and 252 deletions

View File

@@ -1,29 +1,13 @@
//! Configuration structs
use once_cell::sync::Lazy;
use std::time;
use lazy_static::lazy_static;
pub static BINCODE_CONFIG: Lazy<bincode::config::Configuration> =
Lazy::new(|| {
lazy_static! {
pub static ref BINCODE_CONFIG: bincode::config::Configuration =
bincode::config::standard()
.with_little_endian()
.with_no_limit()
});
pub static REQWEST_CLIENT: Lazy<reqwest::Client> = Lazy::new(|| {
let mut headers = reqwest::header::HeaderMap::new();
let header = reqwest::header::HeaderValue::from_str(&format!(
"modrinth/daedalus/{} (support@modrinth.com)",
env!("CARGO_PKG_VERSION")
))
.unwrap();
headers.insert(reqwest::header::USER_AGENT, header);
reqwest::Client::builder()
.tcp_keepalive(Some(time::Duration::from_secs(10)))
.default_headers(headers)
.build()
.expect("Reqwest Client Building Failed")
});
.with_no_limit();
}
pub const MODRINTH_API_URL: &str = "https://api.modrinth.com/v2/";