You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
502 B

package config
import (
"gopkg.in/yaml.v3"
"os"
"wss-pool/logging/applogger"
"wss-pool/pkg/model"
)
var Config model.Config
// LoadConfig Load config
func LoadConfig(urlPath string) {
dataBytes, err := os.ReadFile(urlPath)
if err != nil {
applogger.Info("fail to read file:%v", err)
return
}
err = yaml.Unmarshal(dataBytes, &Config)
if err != nil {
applogger.Info("Failed to parse yaml file:%v", string(dataBytes), err.Error())
return
}
applogger.Info("config---->:%v", Config)
}