feat(config): add config-as-code YAML import/export
Add declarative config-as-code support via YAML files. Monitors and alerts can be exported, version controlled, and applied across instances. - goupkeep export [-o file.yaml] dumps current state - goupkeep apply -f file.yaml creates/updates to match desired state - --dry-run shows planned changes without applying - --prune deletes monitors/alerts not in the YAML - Matching by name, alert references by name, nested group children - CLI refactored to subcommands (apply, export, serve) with backward compat - 24 tests covering apply, export, validation, round-trip idempotency
This commit is contained in:
@@ -21,6 +21,12 @@ type Store interface {
|
||||
UpdateAlert(id int, name, aType string, settings map[string]string) error
|
||||
DeleteAlert(id int) error
|
||||
|
||||
// Declarative config support
|
||||
GetSiteByName(name string) (models.Site, error)
|
||||
GetAlertByName(name string) (models.AlertConfig, error)
|
||||
AddSiteReturningID(site models.Site) (int, error)
|
||||
AddAlertReturningID(name, aType string, settings map[string]string) (int, error)
|
||||
|
||||
// Users
|
||||
GetAllUsers() ([]models.User, error)
|
||||
AddUser(username, publicKey, role string) error
|
||||
|
||||
Reference in New Issue
Block a user