diff --git a/pkg/servicestat/list.go b/pkg/servicestat/list.go index 213f4b4..b481aef 100644 --- a/pkg/servicestat/list.go +++ b/pkg/servicestat/list.go @@ -1,3 +1,22 @@ package servicestat +import ( + "encoding/json" + "net/http" +) + type ServiceList map[string]bool + +func GatherStatus(url string) (lst ServiceList, err error) { + rq, _ := http.NewRequest(http.MethodGet, url, nil) + rq.Header.Set("Content-Type", "application/json") + + cl := &http.Client{} + r, err := cl.Do(rq) + if err != nil { + return lst, err + } + lst = make(ServiceList) + err = json.NewDecoder(r.Body).Decode(&lst) + return lst, err +}