()
| 259 | } |
| 260 | |
| 261 | func getMe() (map[string]any, error) { |
| 262 | resp, err := DoRequest(http.MethodGet, common.BaseUrl+UserinfoEndpoint, nil, nil) |
| 263 | if err != nil { |
| 264 | return nil, err |
| 265 | } |
| 266 | if resp.StatusCode != http.StatusOK { |
| 267 | return nil, errors.New(resp.Status) |
| 268 | } |
| 269 | var res = make(map[string]any) |
| 270 | err = json.NewDecoder(resp.Body).Decode(&res) |
| 271 | if err != nil { |
| 272 | return nil, err |
| 273 | } |
| 274 | return res, nil |
| 275 | } |
| 276 | |
| 277 | func getUsage() (map[string]any, error) { |
| 278 | resp, err := DoRequest(http.MethodGet, common.BaseUrl+UsageEndpoint, nil, nil) |
no test coverage detected