Add RateLimit() function to gh client

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2025-04-28 13:37:33 +00:00
parent fafe98e62f
commit 73340da322
5 changed files with 54 additions and 29 deletions

View file

@ -18,6 +18,7 @@ type GithubEntityOperations interface {
ListEntityRunners(ctx context.Context, opts *github.ListRunnersOptions) (*github.Runners, *github.Response, error)
ListEntityRunnerApplicationDownloads(ctx context.Context) ([]*github.RunnerApplicationDownload, *github.Response, error)
RemoveEntityRunner(ctx context.Context, runnerID int64) error
RateLimit(ctx context.Context) (*github.RateLimits, error)
CreateEntityRegistrationToken(ctx context.Context) (*github.RegistrationToken, *github.Response, error)
GetEntityJITConfig(ctx context.Context, instance string, pool params.Pool, labels []string) (jitConfigMap map[string]string, runner *github.Runner, err error)

View file

@ -64,3 +64,7 @@ func (s *stubGithubClient) GetEntity() params.GithubEntity {
func (s *stubGithubClient) GithubBaseURL() *url.URL {
return nil
}
func (s *stubGithubClient) RateLimit(_ context.Context) (*github.RateLimits, error) {
return nil, s.err
}