Documentation ¶
Index ¶
- Constants
- type GithubClient
- type GithubService
- func (gc *GithubService) Authorized() bool
- func (gs *GithubService) GetLanguagesForRepoAsync(repo *github.Repository) rxgo.Observable
- func (gs *GithubService) GetOutsideContributions(user string) ([]*github.Repository, error)
- func (gs *GithubService) GetOutsideContributionsAsync(user string) rxgo.Observable
- func (gs *GithubService) GetRepo(owner, repoName string) (*github.Repository, error)
- func (gs *GithubService) GetRepoForksCount(owner, repoName string) (int, error)
- func (gs *GithubService) GetRepoStarsCount(owner, repoName string) (int, error)
- func (gs *GithubService) GetTotalCountOfCommitsByUsername(owner, repo, username string) (int, error)
- func (gs *GithubService) GetUser(username string) (*github.User, error)
- func (gs *GithubService) ListAllOrganizationsAsync(user string) rxgo.Observable
- func (gs *GithubService) ListAllReposInOrgAsync(org string) rxgo.Observable
- func (gs *GithubService) ListAllRepositoriesAsync(user string) rxgo.Observable
- func (gs *GithubService) ListRepoLanguages(owner, repo string) (map[string]int, error)
- func (gs *GithubService) ListRepositories(user string, opts *github.RepositoryListOptions) ([]*github.Repository, *github.Response, error)
- func (gs *GithubService) NextClient() *GithubClient
- func (gs *GithubService) SearchCode(pageNumber int, perPageSum int, query string) (*github.CodeSearchResult, bool, error)
Constants ¶
View Source
const ( PerPage = 30 // Max 100, but it triggers anti abuse system DefaultRateLimit = 200 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GithubClient ¶
type GithubClient struct { HTTP *github.Client GraphQL *githubv4.Client // contains filtered or unexported fields }
func (*GithubClient) DefaultThrottle ¶
func (gc *GithubClient) DefaultThrottle() *GithubClient
func (*GithubClient) Throttle ¶
func (gc *GithubClient) Throttle(rateLimits ...time.Duration) <-chan rxgo.Item
Creates Observable that you can wait via `<-gs.Throttle()`
Follows the default rate limit of 2 seconds for the github
type GithubService ¶
type GithubService struct {
// contains filtered or unexported fields
}
func NewGithubService ¶
func NewGithubService(ctx context.Context, token string) (*GithubService, error)
func (*GithubService) Authorized ¶
func (gc *GithubService) Authorized() bool
Returns true if github service was created with token
func (*GithubService) GetLanguagesForRepoAsync ¶
func (gs *GithubService) GetLanguagesForRepoAsync(repo *github.Repository) rxgo.Observable
func (*GithubService) GetOutsideContributions ¶
func (gs *GithubService) GetOutsideContributions(user string) ([]*github.Repository, error)
func (*GithubService) GetOutsideContributionsAsync ¶
func (gs *GithubService) GetOutsideContributionsAsync(user string) rxgo.Observable
func (*GithubService) GetRepo ¶
func (gs *GithubService) GetRepo(owner, repoName string) (*github.Repository, error)
func (*GithubService) GetRepoForksCount ¶
func (gs *GithubService) GetRepoForksCount(owner, repoName string) (int, error)
func (*GithubService) GetRepoStarsCount ¶
func (gs *GithubService) GetRepoStarsCount(owner, repoName string) (int, error)
func (*GithubService) GetTotalCountOfCommitsByUsername ¶
func (gs *GithubService) GetTotalCountOfCommitsByUsername(owner, repo, username string) (int, error)
func (*GithubService) GetUser ¶
func (gs *GithubService) GetUser(username string) (*github.User, error)
func (*GithubService) ListAllOrganizationsAsync ¶
func (gs *GithubService) ListAllOrganizationsAsync(user string) rxgo.Observable
func (*GithubService) ListAllReposInOrgAsync ¶
func (gs *GithubService) ListAllReposInOrgAsync(org string) rxgo.Observable
func (*GithubService) ListAllRepositoriesAsync ¶
func (gs *GithubService) ListAllRepositoriesAsync(user string) rxgo.Observable
func (*GithubService) ListRepoLanguages ¶
func (gs *GithubService) ListRepoLanguages(owner, repo string) (map[string]int, error)
func (*GithubService) ListRepositories ¶
func (gs *GithubService) ListRepositories(user string, opts *github.RepositoryListOptions) ([]*github.Repository, *github.Response, error)
func (*GithubService) NextClient ¶
func (gs *GithubService) NextClient() *GithubClient
func (*GithubService) SearchCode ¶
func (gs *GithubService) SearchCode(pageNumber int, perPageSum int, query string) (*github.CodeSearchResult, bool, error)
Click to show internal directories.
Click to hide internal directories.