(ctx context.Context)
| 556 | } |
| 557 | |
| 558 | func (g *githubClient) RateLimit(ctx context.Context) (*github.RateLimits, error) { |
| 559 | limits, resp, err := g.rateLimit.Get(ctx) |
| 560 | if err != nil { |
| 561 | metrics.GithubOperationFailedCount.WithLabelValues( |
| 562 | "GetRateLimit", // label: operation |
| 563 | g.entity.LabelScope(), // label: scope |
| 564 | ).Inc() |
| 565 | } |
| 566 | if err := parseError(resp, err); err != nil { |
| 567 | return nil, fmt.Errorf("getting rate limit: %w", err) |
| 568 | } |
| 569 | return limits, nil |
| 570 | } |
| 571 | |
| 572 | func (g *githubClient) GetEntity() params.ForgeEntity { |
| 573 | return g.entity |
no test coverage detected