Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrEndpointsNotFound is the returned error when couldn't find // endpoints for a certain repository. ErrEndpointsNotFound = errors.NewKind("endpoinds not found for %s") // ErrNewRepositoriesNotFound is returned when there aren't new // repositories in the organization. ErrNewRepositoriesNotFound = errors.NewKind( "couldn't find new repositories") // ErrRateLimitExceeded is returned when the api rate limit is reached. ErrRateLimitExceeded = errors.NewKind("rate limit requests exceeded") )
Functions ¶
This section is empty.
Types ¶
type GHOrgReposIter ¶
type GHOrgReposIter struct {
// contains filtered or unexported fields
}
GHOrgReposIter is a GHRepositoriesIter by organization name.
func NewGHOrgReposIter ¶
func NewGHOrgReposIter(org string, opts *GHReposIterOpts) *GHOrgReposIter
NewGHOrgReposIter builds a new GHOrgReposIter.
func (*GHOrgReposIter) Next ¶
func (p *GHOrgReposIter) Next( ctx context.Context, ) (*github.Repository, time.Duration, error)
Next implements the GHRepositoriesIter interface.
type GHProvider ¶
type GHProvider struct {
// contains filtered or unexported fields
}
GHProvider is a gitcollector.Provider implementation. It will retrieve the information for all the repositories for the given github organization to produce gitcollector.Jobs.
func NewGHProvider ¶
func NewGHProvider( queue chan<- gitcollector.Job, iter GHRepositoriesIter, opts *GHProviderOpts, ) *GHProvider
NewGHProvider builds a new Provider
func (*GHProvider) Start ¶
func (p *GHProvider) Start() error
Start implements the gitcollector.Provider interface.
func (*GHProvider) Stop ¶
func (p *GHProvider) Stop() error
Stop implements the gitcollector.Provider interface
type GHProviderOpts ¶
type GHProviderOpts struct {
WaitNewRepos bool
WaitOnRateLimit bool
StopTimeout time.Duration
EnqueueTimeout time.Duration
MaxJobBuffer int
}
GHProviderOpts represents configuration options for a GHProvider.
type GHReposIterOpts ¶
type GHReposIterOpts struct {
HTTPTimeout time.Duration
ResultsPerPage int
TimeNewRepos time.Duration
AuthToken string
}
GHReposIterOpts represents configuration options for a GHReposIter.
type GHRepositoriesIter ¶
type GHRepositoriesIter interface {
Next(context.Context) (*github.Repository, time.Duration, error)
}
GHRepositoriesIter represents an iterator of *github.Repositories