Skip to content

VanuPhantom/googol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

googol

TLDR

A library to reduce the boilerplate needed to call Google APIs.

Example usage

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))
}

About

A library to assist with calling Google APIs

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages