github.com/justinjmoses/evergreen@v0.0.0-20170530173719-1d50e381ff0d/runner/registry.go (about)

     1  // Package runner provides a basic interface to run various processes within Evergreen.
     2  // Its primary job is to expose the basic Run method of such process in an abstraction
     3  // that allows them to be executed outside of their main functions.
     4  package runner
     5  
     6  import (
     7  	"github.com/evergreen-ci/evergreen"
     8  	"github.com/evergreen-ci/evergreen/alerts"
     9  	"github.com/evergreen-ci/evergreen/hostinit"
    10  	"github.com/evergreen-ci/evergreen/monitor"
    11  	"github.com/evergreen-ci/evergreen/notify"
    12  	"github.com/evergreen-ci/evergreen/repotracker"
    13  	"github.com/evergreen-ci/evergreen/scheduler"
    14  	"github.com/evergreen-ci/evergreen/taskrunner"
    15  )
    16  
    17  // ProcessRunner wraps a basic Run method that allows various processes in Evergreen
    18  // to be executed outside of their main methods.
    19  type ProcessRunner interface {
    20  	// Name returns the id of the process runner.
    21  	Name() string
    22  	// Description returns a description of the runner for use in -help text.
    23  	Description() string
    24  	// Run executes the process runner with the supplied configuration.
    25  	Run(*evergreen.Settings) error
    26  }
    27  
    28  // Runners is a slice of all Evergreen processes that implement the ProcessRunner interface.
    29  var (
    30  	Runners = []ProcessRunner{
    31  		&hostinit.Runner{},
    32  		&monitor.Runner{},
    33  		&notify.Runner{},
    34  		&repotracker.Runner{},
    35  		&taskrunner.Runner{},
    36  		&alerts.QueueProcessor{},
    37  		&scheduler.Runner{},
    38  	}
    39  )