GetProjectsFromSC returns the projects array from sc
()
| 29 | |
| 30 | // GetProjectsFromSC returns the projects array from sc |
| 31 | func GetProjectsFromSC() ([]*model.Projects, error) { |
| 32 | type response struct { |
| 33 | Result []*model.Projects `json:"result"` |
| 34 | } |
| 35 | |
| 36 | res := new(response) |
| 37 | if err := Get(http.MethodGet, "/v1/config/projects/*", map[string]string{}, res); err != nil { |
| 38 | return nil, err |
| 39 | } |
| 40 | |
| 41 | return res.Result, nil |
| 42 | } |
| 43 | |
| 44 | // GetProjectID checks if project is specified in flags |
| 45 | func GetProjectID() (string, bool) { |
no test coverage detected