()
| 275 | } |
| 276 | |
| 277 | func getUsage() (map[string]any, error) { |
| 278 | resp, err := DoRequest(http.MethodGet, common.BaseUrl+UsageEndpoint, nil, nil) |
| 279 | if err != nil { |
| 280 | return nil, err |
| 281 | } |
| 282 | if resp.StatusCode != http.StatusOK { |
| 283 | return nil, errors.New(resp.Status) |
| 284 | } |
| 285 | var res = make(map[string]any) |
| 286 | err = json.NewDecoder(resp.Body).Decode(&res) |
| 287 | if err != nil { |
| 288 | return nil, err |
| 289 | } |
| 290 | return res, nil |
| 291 | } |