Sha256: 332691a3251a373b995b8b936a8f370c739219d846ee80b169ac3cb9767c1fc2
Contents?: true
Size: 584 Bytes
Versions: 14
Compression:
Stored size: 584 Bytes
Contents
package global import ( "encoding/json" "fmt" "os" ) type ConfigStruct struct { StatsDServerIP string `json:"stats_d_server"` SysLogIP string `json:"syslog_server"` RootFolder string } var Config ConfigStruct func LoadConfig(config string, rootfolder string) error { fmt.Println("Loading Config: ", config) file, err := os.Open(config) if err != nil { return fmt.Errorf("Unable to open config") } decoder := json.NewDecoder(file) Config = ConfigStruct{} err = decoder.Decode(&Config) Config.RootFolder = rootfolder fmt.Println(Config) return nil }
Version data entries
14 entries across 14 versions & 1 rubygems