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.

26 lines
478 B

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