mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2025-07-22 04:41:40 +02:00
Restructure and Cleanup
Compiles
This commit is contained in:
@@ -96,8 +96,9 @@ type Config struct {
|
||||
Nats []*NatsConfig `json:"nats"`
|
||||
}
|
||||
|
||||
func LoadConfiguration(file string) Config {
|
||||
var config Config
|
||||
var Keys Config
|
||||
|
||||
func Init(file string) {
|
||||
configFile, err := os.Open(file)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -105,8 +106,7 @@ func LoadConfiguration(file string) Config {
|
||||
defer configFile.Close()
|
||||
dec := json.NewDecoder(configFile)
|
||||
dec.DisallowUnknownFields()
|
||||
if err := dec.Decode(&config); err != nil {
|
||||
if err := dec.Decode(&Keys); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
Reference in New Issue
Block a user