Initial commit

This commit is contained in:
2025-05-03 15:19:56 -06:00
commit 90c7b9d654
48 changed files with 3192 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
use url::Url;
use url_macro::url;
/// The client configuration
pub struct Config {
/// The base URL of the API
pub base_url: Url,
/// The reqwest client that is used for every request
pub client: reqwest::Client,
/// The bearer token for readonly access to the API
pub bearer_token: String,
/// An optional user agent string to provide to the API
pub user_agent: Option<String>,
}
impl Config {
/// Create a new configuration using the provided bearer token
pub fn new(bearer_token: String) -> Self {
Self {
base_url: url!("https://api.themoviedb.org"),
client: reqwest::Client::new(),
bearer_token,
user_agent: None,
}
}
}