Changed GoConfig to UsrConfig

Changed GoConfig struct to UsrConfig
This commit is contained in:
2026-05-04 11:50:08 -06:00
parent 6ef8f280a8
commit e051d2d6f6
6 changed files with 7 additions and 9 deletions

View File

@@ -9,14 +9,14 @@ import (
"gopkg.in/yaml.v3"
)
func readCfg(factCfg string) GoConfig {
func readCfg(factCfg string) UsrConfig {
//read config file (YAML)
fileBytes, err := os.ReadFile(factCfg)
if err != nil {
log.Fatalf("Error reading config file: %v", err)
}
// return Struct
var config GoConfig
var config UsrConfig
err = yaml.Unmarshal(fileBytes, &config)
if err != nil {
log.Fatalf("Error unmarshalling YAML file: %v", err)
@@ -32,7 +32,7 @@ func isItReal(path string) bool { //check if path exists
return false
}
}
func verifyConfig(config GoConfig) bool { // check each file/dir to see if it exists
func verifyConfig(config UsrConfig) bool { // check each file/dir to see if it exists
if !isItReal(config.Server.ServDir) { //check for Server directory
fmt.Printf("PATH NOT FOUND: %s", config.Server.ServDir)
return false