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.
 
 
 
 
 

27 lines
539 B

package main
import (
"encoding/json"
"io/ioutil"
)
//Config reads the config
type Config struct {
IP string `json:"ip"`
Port string `json:"port"`
WebServerPort string `json:"webserverport"`
Mongodb MongoConfig `json:"mongodb"`
}
type MongoConfig struct {
IP string `json:"ip"`
Database string `json:"database"`
}
var config Config
func readConfig(path string) {
file, err := ioutil.ReadFile(path)
check(err)
content := string(file)
json.Unmarshal([]byte(content), &config)
}