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.

16 lines
289 B

  1. package main
  2. import (
  3. "encoding/json"
  4. "io/ioutil"
  5. "net/http"
  6. )
  7. func getPeers() {
  8. res, err := http.Get("http://" + config.IP + ":" + config.ServerRESTPort + "/peers")
  9. check(err)
  10. body, err := ioutil.ReadAll(res.Body)
  11. check(err)
  12. err = json.Unmarshal(body, &peersList)
  13. check(err)
  14. }