diff options
author | Alexander Scharinger <rng.dynamics@gmail.com> | 2021-03-22 19:26:59 +0100 |
---|---|---|
committer | Alexander Scharinger <rng.dynamics@gmail.com> | 2021-03-22 19:26:59 +0100 |
commit | 2646c63213cb4d1fa04e1b61051f4ac97c1978f0 (patch) | |
tree | 59506a5619ea4efee511a64096679baadb59ed7f /bridge/github/import_query.go | |
parent | 52fba350d6d127d5c50aca34aabcca1ef0d26d75 (diff) | |
download | git-bug-2646c63213cb4d1fa04e1b61051f4ac97c1978f0.tar.gz |
Github bridge: Refactor
Diffstat (limited to 'bridge/github/import_query.go')
-rw-r--r-- | bridge/github/import_query.go | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/bridge/github/import_query.go b/bridge/github/import_query.go index c4ab2aa9..461daf94 100644 --- a/bridge/github/import_query.go +++ b/bridge/github/import_query.go @@ -2,6 +2,19 @@ package github import "github.com/shurcooL/githubv4" +type rateLimit struct { + Cost githubv4.Int + Limit githubv4.Int + NodeCount githubv4.Int + Remaining githubv4.Int + ResetAt githubv4.DateTime + Used githubv4.Int +} + +type rateLimiter interface { + rateLimit() rateLimit +} + type userQuery struct { RateLimit rateLimit `graphql:"rateLimit(dryRun: $dryRun)"` User user `graphql:"user(login: $login)"` @@ -211,12 +224,3 @@ type pageInfo struct { StartCursor githubv4.String HasPreviousPage bool } - -type rateLimit struct { - Cost githubv4.Int - Limit githubv4.Int - NodeCount githubv4.Int - Remaining githubv4.Int - ResetAt githubv4.DateTime - Used githubv4.Int -} |