mirror of
https://github.com/speatzle/nfsense.git
synced 2025-09-13 15:19:08 +00:00
Add Basic Config Validation
This commit is contained in:
parent
a04127c0e6
commit
7b0474e4eb
9 changed files with 85 additions and 20 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"time"
|
||||
|
||||
"golang.org/x/exp/slog"
|
||||
"nfsense.net/nfsense/pkg/definitions"
|
||||
"nfsense.net/nfsense/pkg/jsonrpc"
|
||||
"nfsense.net/nfsense/pkg/server"
|
||||
)
|
||||
|
@ -27,6 +28,14 @@ func main() {
|
|||
|
||||
slog.Info("Config Loaded", "config", conf)
|
||||
|
||||
err = definitions.ValidateConfig(conf)
|
||||
if err != nil {
|
||||
slog.Error("Validating Config", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
slog.Info("Validating Config")
|
||||
|
||||
if *applyPtr {
|
||||
slog.Info("Applying Config...")
|
||||
err := apply(conf)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue