feat(storage): add sqlite manager and storage config

This commit is contained in:
2025-10-01 14:52:09 +02:00
parent 0fd24a5cfb
commit 14fb100dab
4 changed files with 163 additions and 4 deletions

View File

@@ -16,10 +16,11 @@ const (
// Config captures runtime configuration for the Goaichat application.
type Config struct {
API APIConfig `yaml:"api"`
Model ModelConfig `yaml:"model"`
API APIConfig `yaml:"api"`
Model ModelConfig `yaml:"model"`
Logging LoggingConfig `yaml:"logging"`
UI UIConfig `yaml:"ui"`
UI UIConfig `yaml:"ui"`
Storage StorageConfig `yaml:"storage"`
}
// APIConfig holds settings for connecting to the OpenAI-compatible API.
@@ -45,6 +46,13 @@ type UIConfig struct {
ShowTimestamps bool `yaml:"show_timestamps"`
}
// StorageConfig controls persistence locations and metadata.
type StorageConfig struct {
Path string `yaml:"path"`
BaseDir string `yaml:"base_dir"`
Username string `yaml:"username"`
}
// Load reads configuration from the provided path, falling back to defaults and
// environment overrides.
func Load(path string) (*Config, error) {
@@ -123,5 +131,6 @@ func defaultConfig() Config {
UI: UIConfig{
ShowTimestamps: true,
},
Storage: StorageConfig{},
}
}