Skip to main content

Crate gcloud_sdk

Crate gcloud_sdk 

Source
Expand description

§Google Cloud SDK for Rust

Library provides all available Google gRPC APIs generated from their proto interfaces.

The library also provides an easy-to-use client API for gRPC that supports Google Authentication natively.

§gRPC example

ⓘ

    let firestore_client: GoogleApi<FirestoreClient<GoogleAuthMiddleware>> =
       GoogleApi::from_function(
           FirestoreClient::new,
           "https://firestore.googleapis.com",
           // cloud resource prefix: used only for some of the APIs (such as Firestore)
           Some(cloud_resource_prefix.clone()),
       )
       .await?;

    let response = firestore_client
        .get()
        .list_documents(tonic::Request::new(ListDocumentsRequest {
            parent: format!("{}/documents", cloud_resource_prefix),
            ..Default::default()
        }))
        .await?;

Complete examples available on github.

Re-exports§

pub use google_cloud_auth;
pub use prost;
pub use prost_types;
pub use tonic;

Modules§

cloud
error
google
grafeas
id_token_verify
Verification of Google-signed ID tokens, for the receiving side of a service-to-service call.
maps
proto_ext

Structs§

GoogleApiClient
GoogleApiClientBuilderFunction
GoogleAuthHeaders
The authentication headers of google-cloud-auth credentials, for every request the tonic and reqwest middleware send: authorization with an access token or an ID token, and whatever else the credentials add, such as x-goog-user-project for a quota project.
GoogleAuthMiddlewareLayer
GoogleAuthReqwestMiddleware
A reqwest-middleware middleware that sets the authentication headers of a GoogleAuthHeaders on every request: authorization with an access token or an ID token, and any other header the credentials add, such as x-goog-user-project.
GoogleEnvironment
HeaderMap
A specialized multimap for header names and values.
IdTokenAudience
The audience an ID token is minted for and checked against: the URL of a Cloud Run service or a Cloud Run function, a custom audience configured on the service, or the OAuth client ID of a resource behind Identity-Aware Proxy.
RequestTimeouts
Client-side time limits for a gRPC call. Both are off by default.
SecretValue
A secret held as bytes and zeroized when it is dropped.
ServiceAccountEmail
The email of a service account, such as invoker@my-project.iam.gserviceaccount.com.
VerifyIdToken
The service made by VerifyIdTokenLayer.
VerifyIdTokenLayer
A tower layer that lets a request through only with a valid Google ID token in its authorization: Bearer header, and puts the token’s claims into the request’s extensions for the VerifiedIdToken extractor.

Enums§

RequestTimeoutElapsed
The limit of a RequestTimeouts that a call ran out of: the source of the Code::DeadlineExceeded status the call fails with.

Constants§

CERTIFICATES
GCLOUD_SDK_USER_AGENT

Statics§

GCP_DEFAULT_SCOPES

Traits§

GoogleApiClientBuilder

Type Aliases§

GoogleApi
GoogleAuthMiddleware