updater

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotUpdateJob is returned when a not update job is found.
	ErrNotUpdateJob = errors.NewKind("not update job")
)

Functions

func Update

func Update(ctx context.Context, job *library.Job) error

Update is a library.JobFn function to update a git repository alreayd stored in a borges.Library.

Types

type UpdatesProvider

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

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

func NewUpdatesProvider

func NewUpdatesProvider(
	lib borges.Library,
	queue chan<- gitcollector.Job,
	opts *UpdatesProviderOpts,
) *UpdatesProvider

NewUpdatesProvider builds a new UpdatesProviders.

func (*UpdatesProvider) Start

func (p *UpdatesProvider) Start() error

Start implements the gitcollector.Provider interface.

func (*UpdatesProvider) Stop

func (p *UpdatesProvider) Stop() error

Stop implements the gitcollector.Provider interface.

type UpdatesProviderOpts

type UpdatesProviderOpts 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
}

UpdatesProviderOpts represents configuration options for an UpdatesProvider.

Jump to

Keyboard shortcuts

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