discovery

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

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

Jump to

Keyboard shortcuts

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