watchyourlan/internal/conf/generate.go
2025-07-23 21:30:18 +07:00

25 lines
504 B
Go

package conf
import (
"github.com/aceberg/WatchYourLAN/internal/check"
"github.com/aceberg/WatchYourLAN/internal/models"
)
// AppConfig - app config
var AppConfig models.Conf
// Generate - initial config
func Generate(dirPath, nodePath string) {
confPath := dirPath + "/config_v2.yaml"
check.Path(confPath)
AppConfig = read(confPath)
AppConfig.DirPath = dirPath
AppConfig.ConfPath = confPath
AppConfig.DBPath = dirPath + "/scan.db"
if nodePath != "" {
AppConfig.NodePath = nodePath
}
}