github: refactor API client to only associate with one token
Created by: unknwon
This is pure refactoring and should not change any functionality, it simplifies the design of the GitHub client to only associate with exactly one token.
Why?
- With the introduction of
WithToken
method, it is not necessary to pass around thetoken
argument anymore. - Simplifies the management of repository cache, instead of holding a map of caches for different tokens, just one cache object that is associated with the token. Much easier to reason.
NOTE: I'll fix failing tests that require a bit more effort once get approval for the core change.