provider

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

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,
	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