mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 19:08:20 +00:00
29 lines
618 B
Go
29 lines
618 B
Go
package config
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"nfsense.net/nfsense/internal/definitions/config"
|
|
)
|
|
|
|
type ConfigManager struct {
|
|
currentConfigFilePath string
|
|
pendingConfigFilePath string
|
|
|
|
currentConfig *config.Config
|
|
pendingConfig *config.Config
|
|
|
|
transactionMutex sync.Mutex
|
|
|
|
applyFunctions []func(currentConfig config.Config, pendingConfig config.Config) error
|
|
}
|
|
|
|
func CreateConfigManager() *ConfigManager {
|
|
manager := ConfigManager{
|
|
currentConfigFilePath: "config.json",
|
|
pendingConfigFilePath: "pending.json",
|
|
currentConfig: &config.Config{},
|
|
pendingConfig: &config.Config{},
|
|
}
|
|
return &manager
|
|
}
|