radar

package
v0.0.0-...-2c9ee18 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFailedToAcquireLock = errors.New("failed-to-acquire-lock")

Functions

This section is empty.

Types

type IntervalRunner

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

func NewIntervalRunner

func NewIntervalRunner(
	logger lager.Logger,
	clock clock.Clock,
	name string,
	scanner Scanner,
) *IntervalRunner

func (*IntervalRunner) RunFunc

func (r *IntervalRunner) RunFunc(signals <-chan os.Signal, ready chan<- struct{}) error

type RadarDB

type RadarDB interface {
	GetPipelineName() string
	GetPipelineID() int
	ScopedName(string) string
	TeamID() int
	Config() atc.Config

	IsPaused() (bool, error)

	Reload() (bool, error)

	GetLatestVersionedResource(resourceName string) (db.SavedVersionedResource, bool, error)
	GetResource(resourceName string) (db.SavedResource, bool, error)
	GetResourceType(resourceTypeName string) (db.SavedResourceType, bool, error)
	PauseResource(resourceName string) error
	UnpauseResource(resourceName string) error

	SaveResourceVersions(atc.ResourceConfig, []atc.Version) error
	SaveResourceTypeVersion(atc.ResourceType, atc.Version) error
	SetResourceCheckError(resource db.SavedResource, err error) error
	AcquireResourceTypeCheckingLock(logger lager.Logger, resourceType db.SavedResourceType, interval time.Duration, immediate bool) (lock.Lock, bool, error)
}

type Runner

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

func NewRunner

func NewRunner(
	logger lager.Logger,
	noop bool,
	scanRunnerFactory ScanRunnerFactory,
	db db.PipelineDB,
	syncInterval time.Duration,
) *Runner

func (*Runner) Run

func (runner *Runner) Run(signals <-chan os.Signal, ready chan<- struct{}) error

type ScanRunnerFactory

type ScanRunnerFactory interface {
	ScanResourceRunner(lager.Logger, string) ifrit.Runner
	ScanResourceTypeRunner(lager.Logger, string) ifrit.Runner
}

func NewScanRunnerFactory

func NewScanRunnerFactory(
	resourceFactory resource.ResourceFactory,
	defaultInterval time.Duration,
	db RadarDB,
	dbPipeline dbng.Pipeline,
	clock clock.Clock,
	externalURL string,
) ScanRunnerFactory

type Scanner

type Scanner interface {
	Run(lager.Logger, string) (time.Duration, error)
	Scan(lager.Logger, string) error
	ScanFromVersion(lager.Logger, string, atc.Version) error
}

func NewResourceScanner

func NewResourceScanner(
	clock clock.Clock,
	resourceFactory resource.ResourceFactory,
	defaultInterval time.Duration,
	db RadarDB,
	dbPipeline dbng.Pipeline,
	externalURL string,
) Scanner

func NewResourceTypeScanner

func NewResourceTypeScanner(
	resourceFactory resource.ResourceFactory,
	defaultInterval time.Duration,
	db RadarDB,
	externalURL string,
) Scanner

type ScannerFactory

type ScannerFactory interface {
	NewResourceScanner(db RadarDB, dbPipeline dbng.Pipeline) Scanner
}

func NewScannerFactory

func NewScannerFactory(
	resourceFactory resource.ResourceFactory,
	defaultInterval time.Duration,
	externalURL string,
) ScannerFactory

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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