aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-03 12:12:25 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-03 12:12:25 +0200
commitbd9ff432d716020d7235ece76257b60dc3ead95a (patch)
treefe2819ccf30bea4d0190b6b7de2efc8a02da61d0 /src/util
parentdf0877bbba91d210fa8a91bd095ca13e0ea2176f (diff)
downloadgarage-bd9ff432d716020d7235ece76257b60dc3ead95a.tar.gz
garage-bd9ff432d716020d7235ece76257b60dc3ead95a.zip
Garage works on sqlite, but it's a hack
Diffstat (limited to 'src/util')
-rw-r--r--src/util/config.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/util/config.rs b/src/util/config.rs
index 99ebce31..3b37adbb 100644
--- a/src/util/config.rs
+++ b/src/util/config.rs
@@ -64,14 +64,19 @@ pub struct Config {
#[serde(default)]
pub kubernetes_skip_crd: bool,
+ // -- DB
+ /// Database engine to use for metadata (options: sled, sqlite)
+ #[serde(default = "default_db_engine")]
+ pub db_engine: String,
+
/// Sled cache size, in bytes
#[serde(default = "default_sled_cache_capacity")]
pub sled_cache_capacity: u64,
-
/// Sled flush interval in milliseconds
#[serde(default = "default_sled_flush_every_ms")]
pub sled_flush_every_ms: u64,
+ // -- APIs
/// Configuration for S3 api
pub s3_api: S3ApiConfig,
@@ -129,6 +134,10 @@ pub struct AdminConfig {
pub trace_sink: Option<String>,
}
+fn default_db_engine() -> String {
+ "sled".into()
+}
+
fn default_sled_cache_capacity() -> u64 {
128 * 1024 * 1024
}