mechiru / googapis Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
https://docs.rs/prost-build/0.7.0/prost_build/struct.Config.html#method.bytes
This can facilitate fewer copies when working with data-heavy APIs.
I'm not certain if this is a bug in the lib or if I'm doing something wrong but I feel like I followed the example pretty closely.
#![allow(unused_imports)]
use googapis::{
CERTIFICATES,
google::cloud::compute::v1::{
Instance,
ForwardingRule,
GetInstanceRequest,
ListInstancesRequest,
AggregatedListInstancesRequest,
instances_client::InstancesClient,
InstanceAggregatedList,
projects_client::ProjectsClient,
GetProjectRequest
},
};
use gouth::Token;
use tonic::{
metadata::MetadataValue,
transport::{Certificate, Channel, ClientTlsConfig},
Request,
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + 'static>> {
let token = Token::new()?;
let tls_config = ClientTlsConfig::new()
.ca_certificate(Certificate::from_pem(CERTIFICATES))
.domain_name("compute.googleapis.com");
let channel = Channel::from_static("https://compute.googleapis.com")
.tls_config(tls_config)?
.connect()
.await?;
let mut service = ProjectsClient::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 instances = service.get(Request::new(GetProjectRequest {
project: "<project >".into(),
..Default::default()
}))
.await?;
println!("{:#?}", instances);
Ok(())
}
and the response looks like
Error: Status { code: Internal, message: "protocol error: received message with invalid compression flag: 60 (valid flags are 0 and 1) while receiving response with status: 404 Not Found", metadata: MetadataMap { headers: {"content-type": "text/html; charset=UTF-8", "referrer-policy": "no-referrer", "content-length": "1597", "date": "Sun, 28 Nov 2021 16:14:35 GMT", "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""} }, source: None }
I'm using 0.6
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
googapis/Cargo.toml
tonic 0.6.1
prost 0.9.0
prost-types 0.9.0
xtask/Cargo.toml
tonic-build 0.6
prost-build 0.9
.gitmodules
xtask/proto/googleapis master@02df998e40733c077aa0fc3f35a6b2d48aa8bf84
.github/workflows/ci.yml
actions/checkout v2
actions-rs/toolchain v1
.github/workflows/doc.yml
actions/checkout v2
actions-rs/toolchain v1
peaceiris/actions-gh-pages v3
As of hyperium/tonic#660, it is convenient to simply enable the tonic tls-webpki-roots
crate feature.
With that feature enabled, one can omit tls_config()
on the Channel
and everything JustWorks:tm:
I'm planning to do an automated test triggered by an update of the renovate bot's git submodule, merge it if it works, and publish it to crates.io.
I did it manually for the first few months, but when I'm busy it gets harder to update. So I think we need to prioritize this task.
The following needs to be resolved :
The name googapis
is confusing and does not fully explain the function of the crate.
The google-api-proto
is explicit and I think it makes sense to change it.
There are multiple versions of 0.3.0 and 0.3.1... cargo
downloads one version and validates against the other one. this is a long standing bug, but basically you just need to bump the version number every publish.
> cargo build
Downloaded googapis v0.3.1+20200930
error: failed to verify the checksum of `googapis v0.3.1+20200930`
see for more info rust-lang/crates.io#1059
This is the Perspective API, which is requires registration (and therefore authorization) to use. Dunno if it would be possible, but it would be great if this crate included it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.