provider

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: GPL-3.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUpdatesStopped is returned when a provider has been stopped.
	ErrUpdatesStopped = errors.NewKind("provider stopped")

	// ErrUpdatesStop is returned when a provider fails on Stop.
	ErrUpdatesStop = errors.NewKind("provider failed on stop")
)

Functions

func AdvertiseGHRepositoriesOnJobQueue

func AdvertiseGHRepositoriesOnJobQueue(
	queue chan<- gitcollector.Job,
) discovery.AdvertiseGHRepositoriesFn

AdvertiseGHRepositoriesOnJobQueue sends the discovered repositories as a gitcollector.Jobs to the given channel. It makes a discovery.GitHub plays as a gitcollector.Provider

func NewGitHubOrg

func NewGitHubOrg(
	org string,
	excludedRepos []string,
	authToken string,
	queue chan<- gitcollector.Job,
	opts *discovery.GitHubOpts,
) *discovery.GitHub

NewGitHubOrg builds a new gitcollector.Provider based on a discovery.Github.

Types

type Updates

type Updates struct {
	// contains filtered or unexported fields
}

Updates is a gitcollector.Provider implementation. It will periodically trigger the gitcollector.Jobs production to update the git repositories hold in a borges.Library

func NewUpdates

func NewUpdates(
	lib borges.Library,
	queue chan<- gitcollector.Job,
	opts *UpdatesOpts,
) *Updates

NewUpdates builds a new Updates.

func (*Updates) Start

func (p *Updates) Start() error

Start implements the gitcollector.Provider interface.

func (*Updates) Stop

func (p *Updates) Stop() error

Stop implements the gitcollector.Provider interface.

type UpdatesOpts

type UpdatesOpts struct {
	// TriggerOnce triggers the update just once and exits.
	TriggerOnce bool
	// TriggerInterval is the time interval elapsed between updates.
	TriggerInterval time.Duration
	// EnqueueTimeout is the time a job waits to be enqueued.
	EnqueueTimeout time.Duration
	// StopTimeout is the time the service waits to be stopped after a Stop
	// call is performed.
	StopTimeout time.Duration
}

UpdatesOpts represents configuration options for an Updates.

Jump to

Keyboard shortcuts

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