feat(config): Add SaveConfig method to persist configuration

This commit is contained in:
2026-01-02 22:51:19 +02:00
parent ebd03d10ad
commit 59d8d11390

View File

@@ -122,6 +122,14 @@ func (m *Manager) Set(key string, value interface{}) {
m.v.Set(key, value)
}
// SaveConfig writes the current configuration to the specified path
func (m *Manager) SaveConfig(path string) error {
if err := m.v.WriteConfigAs(path); err != nil {
return fmt.Errorf("failed to save config to %s: %w", path, err)
}
return nil
}
// setDefaults sets default configuration values
func setDefaults(v *viper.Viper) {
// Server defaults