MCPcopy Create free account
hub / github.com/cloudbase/garm / RateLimit

Method RateLimit

util/github/client.go:558–570  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

556}
557
558func (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
572func (g *githubClient) GetEntity() params.ForgeEntity {
573 return g.entity

Callers 1

ClientFunction · 0.95

Calls 3

parseErrorFunction · 0.85
LabelScopeMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected