From f3d07e6f153037250c52fe39a8d3aeb70cea87f1 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 20 Apr 2022 15:06:28 +0200 Subject: [PATCH] api-types: DataStoreConfig::new for testing so our examples can more easily access a datastore without going over a configuration & cache Signed-off-by: Wolfgang Bumiller --- pbs-api-types/src/datastore.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index 7b988b93..2bff64b5 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -316,6 +316,27 @@ pub struct DataStoreConfig { } impl DataStoreConfig { + pub fn new(name: String, path: String) -> Self { + Self { + name, + path, + comment: None, + gc_schedule: None, + prune_schedule: None, + keep_last: None, + keep_hourly: None, + keep_daily: None, + keep_weekly: None, + keep_monthly: None, + keep_yearly: None, + verify_new: None, + notify_user: None, + notify: None, + tuning: None, + maintenance_mode: None, + } + } + pub fn get_maintenance_mode(&self) -> Option { self.maintenance_mode .as_ref()