chore(docs): Fix examples link (#202)
* url is just examples, not tonic-examples * Change root directory from tonic-examples to examples. Matches current directory structure.
This commit is contained in:
@@ -25,7 +25,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let bearer_token = format!("Bearer {}", token);
|
||||
let header_value = HeaderValue::from_str(&bearer_token)?;
|
||||
|
||||
let certs = tokio::fs::read("tonic-examples/data/gcp/roots.pem").await?;
|
||||
let certs = tokio::fs::read("examples/data/gcp/roots.pem").await?;
|
||||
|
||||
let tls_config = ClientTlsConfig::new()
|
||||
.ca_certificate(Certificate::from_pem(certs.as_slice()))
|
||||
|
||||
@@ -7,7 +7,7 @@ use tonic::transport::{Certificate, Channel, ClientTlsConfig};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let pem = tokio::fs::read("tonic-examples/data/tls/ca.pem").await?;
|
||||
let pem = tokio::fs::read("examples/data/tls/ca.pem").await?;
|
||||
let ca = Certificate::from_pem(pem);
|
||||
|
||||
let tls = ClientTlsConfig::new()
|
||||
|
||||
@@ -51,8 +51,8 @@ impl pb::echo_server::Echo for EchoServer {
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let cert = tokio::fs::read("tonic-examples/data/tls/server.pem").await?;
|
||||
let key = tokio::fs::read("tonic-examples/data/tls/server.key").await?;
|
||||
let cert = tokio::fs::read("examples/data/tls/server.pem").await?;
|
||||
let key = tokio::fs::read("examples/data/tls/server.key").await?;
|
||||
|
||||
let identity = Identity::from_pem(cert, key);
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ use tonic::transport::{Certificate, Channel, ClientTlsConfig, Identity};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let server_root_ca_cert = tokio::fs::read("tonic-examples/data/tls/ca.pem").await?;
|
||||
let server_root_ca_cert = tokio::fs::read("examples/data/tls/ca.pem").await?;
|
||||
let server_root_ca_cert = Certificate::from_pem(server_root_ca_cert);
|
||||
let client_cert = tokio::fs::read("tonic-examples/data/tls/client1.pem").await?;
|
||||
let client_key = tokio::fs::read("tonic-examples/data/tls/client1.key").await?;
|
||||
let client_cert = tokio::fs::read("examples/data/tls/client1.pem").await?;
|
||||
let client_key = tokio::fs::read("examples/data/tls/client1.key").await?;
|
||||
let client_identity = Identity::from_pem(client_cert, client_key);
|
||||
|
||||
let tls = ClientTlsConfig::new()
|
||||
|
||||
@@ -27,11 +27,11 @@ impl pb::echo_server::Echo for EchoServer {
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let cert = tokio::fs::read("tonic-examples/data/tls/server.pem").await?;
|
||||
let key = tokio::fs::read("tonic-examples/data/tls/server.key").await?;
|
||||
let cert = tokio::fs::read("examples/data/tls/server.pem").await?;
|
||||
let key = tokio::fs::read("examples/data/tls/server.key").await?;
|
||||
let server_identity = Identity::from_pem(cert, key);
|
||||
|
||||
let client_ca_cert = tokio::fs::read("tonic-examples/data/tls/client_ca.pem").await?;
|
||||
let client_ca_cert = tokio::fs::read("examples/data/tls/client_ca.pem").await?;
|
||||
let client_ca_cert = Certificate::from_pem(client_ca_cert);
|
||||
|
||||
let addr = "[::1]:50051".parse().unwrap();
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@
|
||||
//! [`hyper`]: https://docs.rs/hyper
|
||||
//! [`tower`]: https://docs.rs/tower
|
||||
//! [`tonic-build`]: https://docs.rs/tonic-build
|
||||
//! [`tonic-examples`]: https://github.com/hyperium/tonic/tree/master/tonic-examples
|
||||
//! [`tonic-examples`]: https://github.com/hyperium/tonic/tree/master/examples
|
||||
//! [`Codec`]: codec/trait.Codec.html
|
||||
//! [`Channel`]: transport/struct.Channel.html
|
||||
//! [`Server`]: transport/struct.Server.html
|
||||
|
||||
Reference in New Issue
Block a user