Crates.io | googol |
lib.rs | googol |
version | 0.2.0 |
source | src |
created_at | 2024-03-16 21:21:52.418829 |
updated_at | 2024-07-07 13:52:54.270795 |
description | A generic library to call Google APIs |
homepage | https://vanu.dev/projects/googol |
repository | https://github.com/VanuPhantom/googol |
max_upload_size | |
id | 1175986 |
size | 5,447 |
A library to reduce the boilerplate needed to call Google APIs.
const SCOPES: &'static [&'static str] = &["https://www.googleapis.com/auth/firebase.messaging"];
#[cfg(debug_assertions)]
static GCP_AUTHENTICATION_CLIENT: googol::Client =
googol::Client::from_file("credentials.json", SCOPES);
#[cfg(not(debug_assertions))]
static GCP_AUTHENTICATION_CLIENT: googol::Client = googol::Client::from_environment(SCOPES);
async fn get_auth_token() -> Result<Token, Error> {
GCP_AUTHENTICATION_CLIENT
.get_token()
.await
.or(Err(Error::AuthError))
}