arnaucube
arnaucube/blockchainIDsystemPublic Self-hosted repository
blockchainIDsystem/clientApp/readConfig.go
clientApp/readConfig.goRaw
 1package main
 2
 3import (
 4	"encoding/json"
 5	"io/ioutil"
 6)
 7
 8//Config reads the config
 9type Config struct {
10	Port           string `json:"port"`
11	KeysDirectory  string `json:"keysDirectory"`
12	ServerIDSigner string `json:"serverIDsigner"`
13}
14
15var config Config
16
17func readConfig(path string) {
18	file, err := ioutil.ReadFile(path)
19	check(err)
20	content := string(file)
21	json.Unmarshal([]byte(content), &config)
22}