Add docs to transport and refactor some api's

This commit is contained in:
Lucio Franco
2019-09-29 17:04:42 -04:00
parent 1d9e3daa07
commit a35ef96a03
16 changed files with 485 additions and 233 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
endpoint.openssl_tls(ca, Some("foo.test.google.fr".into()));
}
let channel = endpoint.channel()?;
let channel = endpoint.channel();
let mut client = client::TestClient::new(channel.clone());
let mut unimplemented_client = client::UnimplementedClient::new(channel);
-24
View File
@@ -15,30 +15,6 @@ const TEST_STATUS_MESSAGE: &'static str = "test status message";
const SPECIAL_TEST_STATUS_MESSAGE: &'static str =
"\t\ntest with whitespace\r\nand Unicode BMP ☺ and non-BMP 😈\t\n";
pub async fn create(origin: http::Uri) -> Result<TestClient, Box<dyn std::error::Error>> {
// let ca = tokio::fs::read("tonic-interop/data/ca.pem").await?;
let svc = Channel::builder()
// .tls(ca)
// .tls_override_domain("foo.test.google.fr")
.build(origin)?;
Ok(TestServiceClient::new(svc))
}
pub async fn create_unimplemented(
origin: http::Uri,
) -> Result<UnimplementedClient, Box<dyn std::error::Error>> {
// let ca = tokio::fs::read("tonic-interop/data/ca.pem").await?;
let svc = Channel::builder()
// .tls(ca)
// .tls_override_domain("foo.test.google.fr")
.build(origin)?;
Ok(UnimplementedServiceClient::new(svc))
}
pub async fn empty_unary(client: &mut TestClient, assertions: &mut Vec<TestAssertion>) {
let result = client.empty_call(Request::new(Empty {})).await;