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.

25 lines
485 B

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