refactor: merge new storage backend into main

This is in preparation for s3 storage support
This commit is contained in:
Per Stark
2025-09-14 12:19:34 +02:00
parent 69954cf78e
commit 62d909bb7e
9 changed files with 397 additions and 147 deletions

View File

@@ -1,6 +1,16 @@
use config::{Config, ConfigError, Environment, File};
use serde::Deserialize;
#[derive(Clone, Deserialize, Debug)]
#[serde(rename_all = "lowercase")]
pub enum StorageKind {
Local,
}
fn default_storage_kind() -> StorageKind {
StorageKind::Local
}
#[derive(Clone, Deserialize, Debug)]
pub struct AppConfig {
pub openai_api_key: String,
@@ -14,6 +24,8 @@ pub struct AppConfig {
pub http_port: u16,
#[serde(default = "default_base_url")]
pub openai_base_url: String,
#[serde(default = "default_storage_kind")]
pub storage: StorageKind,
}
fn default_data_dir() -> String {