diff options
| author | mo khan <mo@mokhan.ca> | 2025-06-18 16:34:43 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-06-18 16:34:43 -0600 |
| commit | f7d1396c5634e14a7aafdd5c8f6e644aca6e5fb0 (patch) | |
| tree | 161c6b656d3366d64109bc85c637a7a7f6f7e679 /src/client.rs | |
| parent | 68558decefd9562a5c8ee3ffa9c197b244e65321 (diff) | |
refactor: remove all the tutorial code
Diffstat (limited to 'src/client.rs')
| -rw-r--r-- | src/client.rs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/client.rs b/src/client.rs deleted file mode 100644 index b0cfa42..0000000 --- a/src/client.rs +++ /dev/null @@ -1,39 +0,0 @@ -use authz::AllowRequest; -use authz::ability_client::AbilityClient; -use hello_world::HelloRequest; -use hello_world::greeter_client::GreeterClient; - -pub mod authz { - tonic::include_proto!("authz.rpc"); -} - -pub mod hello_world { - tonic::include_proto!("helloworld"); -} - -#[tokio::main] -async fn main() -> Result<(), Box<dyn std::error::Error>> { - { - let mut client = GreeterClient::connect("http://[::1]:50051").await?; - let request = tonic::Request::new(HelloRequest { - name: "Tonic".into(), - }); - - let response = client.say_hello(request).await?; - println!("RESPONSE={:?}", response); - } - - { - let request = tonic::Request::new(AllowRequest { - subject: "gid://example/User/1".into(), - permission: "gid://example/Permission/1".into(), - resource: "gid://example/Project/1".into(), - }); - - let mut client = AbilityClient::connect("http://[::1]:50051").await?; - let response = client.allowed(request).await?; - println!("RESPONSE={:?}", response); - } - - Ok(()) -} |
