use crate::query; pub(crate) mod auth; pub(crate) mod repo; pub(crate) mod user; #[derive(Clone)] pub struct QueryContext { pub(crate) http: reqwest::Client, pub(crate) auth: Option, pub(crate) github: GithubCredentials, } #[derive(Clone)] pub(crate) struct Auth { pub(crate) access_token: &'static str, pub(crate) refresh_token: &'static str, } #[derive(Clone)] pub(crate) struct GithubCredentials { pub(crate) client_id: &'static str, } pub enum Error { Unauthenticated, MalformedResponse(serde_json::Error), HttpError(reqwest::Error), } impl query::Context for QueryContext {} impl From for Error { fn from(value: reqwest::Error) -> Self { Self::HttpError(value) } } impl From for Error { fn from(value: serde_json::Error) -> Self { Self::MalformedResponse(value) } }