From 51d0c14e440f00f24dbed6c3bce915a183a2bb65 Mon Sep 17 00:00:00 2001 From: Quentin Date: Thu, 10 Dec 2020 18:13:32 +0100 Subject: [PATCH] CLI structure --- src/garage/admin_rpc.rs | 3 +++ src/garage/main.rs | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/garage/admin_rpc.rs b/src/garage/admin_rpc.rs index a23d3e95..65bd24c0 100644 --- a/src/garage/admin_rpc.rs +++ b/src/garage/admin_rpc.rs @@ -155,6 +155,9 @@ impl AdminRpcHandler { &query.key_id, &query.bucket, allow_read, allow_write ))) } + BucketOperation::Website(query) => { + Ok(AdminRPC::Ok(format!("test"))) + } } } diff --git a/src/garage/main.rs b/src/garage/main.rs index 1185871f..7996d1f9 100644 --- a/src/garage/main.rs +++ b/src/garage/main.rs @@ -141,6 +141,21 @@ pub enum BucketOperation { /// Allow key to read or write to bucket #[structopt(name = "deny")] Deny(PermBucketOpt), + + /// Expose as website or not + #[structopt(name = "website")] + Website(WebsiteOpt), +} + +#[derive(Serialize, Deserialize, StructOpt, Debug)] +pub struct WebsiteOpt { + /// Create + #[structopt(long = "create")] + pub create: bool, + + /// Delete + #[structopt(long = "delete")] + pub delete: bool, } #[derive(Serialize, Deserialize, StructOpt, Debug)]