lib

package
v0.0.0-...-ea7af3d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL