docs.rs failed to build googapis-0.5.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
This library generated from Google API using tonic-build.
Example
The complete code can be found here.
Cargo.toml:
[]
= { = "0.4", = ["google-spanner-admin-database-v1"] }
= { = "0.1" }
= { = "0.4", = ["tls"] }
= "0.7"
= "0.7"
= { = "1.1", = ["rt-multi-thread", "time", "fs", "macros"] }
main.rs:
use googapis::{
google::spanner::admin::database::v1::{
database_admin_client::DatabaseAdminClient, ListDatabasesRequest,
},
CERTIFICATES,
};
use gouth::Token;
use tonic::{
metadata::MetadataValue,
transport::{Certificate, Channel, ClientTlsConfig},
Request,
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let project = std::env::var("PROJECT")?;
let instance = std::env::var("INSTANCE")?;
let token = Token::new()?;
let tls_config = ClientTlsConfig::new()
.ca_certificate(Certificate::from_pem(CERTIFICATES))
.domain_name("spanner.googleapis.com");
let channel = Channel::from_static("https://spanner.googleapis.com")
.tls_config(tls_config)?
.connect()
.await?;
let mut service = DatabaseAdminClient::with_interceptor(channel, move |mut req: Request<()>| {
let token = &*token.header_value().unwrap();
let meta = MetadataValue::from_str(token).unwrap();
req.metadata_mut().insert("authorization", meta);
Ok(req)
});
let response = service
.list_databases(Request::new(ListDatabasesRequest {
parent: format!("projects/{}/instances/{}", project, instance),
page_size: 100,
..Default::default()
}))
.await?;
println!("RESPONSE={:?}", response);
Ok(())
}