Documentation ¶
Index ¶
- func NewJobFromDescriptor(ctx xcontext.Context, registry *pluginregistry.PluginRegistry, ...) (*job.Job, error)
- func NewJobFromExtendedDescriptor(ctx xcontext.Context, registry *pluginregistry.PluginRegistry, ...) (*job.Job, error)
- func NewJobFromJSONDescriptor(ctx xcontext.Context, registry *pluginregistry.PluginRegistry, ...) (*job.Job, error)
- type ErrorEventPayload
- type JobManager
- type Option
- type OptionAPI
- type OptionInstanceTag
- type OptionTargetLockDuration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJobFromDescriptor ¶
func NewJobFromDescriptor(ctx xcontext.Context, registry *pluginregistry.PluginRegistry, jobDescriptor *job.Descriptor) (*job.Job, error)
NewJobFromDescriptor creates a job object from a job descriptor
func NewJobFromExtendedDescriptor ¶
func NewJobFromExtendedDescriptor(ctx xcontext.Context, registry *pluginregistry.PluginRegistry, jobDescriptor *job.ExtendedDescriptor) (*job.Job, error)
NewJobFromExtendedDescriptor creates a job object from an extended job descriptor
func NewJobFromJSONDescriptor ¶
func NewJobFromJSONDescriptor(ctx xcontext.Context, registry *pluginregistry.PluginRegistry, jobDescriptorJSON string) (*job.Job, error)
NewJobFromJSONDescriptor builds a descriptor object from a JSON serialization
Types ¶
type ErrorEventPayload ¶
ErrorEventPayload represents the payload carried by a failure event (e.g. JobStateFailed, JobStateCancelled, etc.)
type JobManager ¶
type JobManager struct {
// contains filtered or unexported fields
}
JobManager is the core component for the long-running job management service. It handles API requests, test fetching, target fetching, and jobs lifecycle.
In more detail, it is responsible for: * spawning the API listener, and handling the incoming requests * fetching targets, via target managers * fetching test definitions, via test fetchers * enqueuing new job requests, and handling their status * starting, stopping, and retrying jobs
func New ¶
func New(l api.Listener, pr *pluginregistry.PluginRegistry, storageEngineVault storage.EngineVault, opts ...Option) (*JobManager, error)
New initializes and returns a new JobManager with the given API listener.
func (*JobManager) CancelAll ¶
func (jm *JobManager) CancelAll(ctx xcontext.Context)
CancelAll cancels all running jobs.
func (*JobManager) CancelJob ¶
func (jm *JobManager) CancelJob(jobID types.JobID) error
CancelJob sends a cancellation request to a specific job.
func (*JobManager) PauseAll ¶
func (jm *JobManager) PauseAll(ctx xcontext.Context)
CancelAll pauses all running jobs.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is an additional argument to method New to change the behavior of the JobManager.
func APIOption ¶
APIOption is a syntax-sugar function which just wraps an api.Option into OptionAPI.
func OptionClock ¶
OptionClock wraps clock.Clock to be used as an option.
type OptionInstanceTag ¶
type OptionInstanceTag string
OptionInstanceTag wraps a string to be used as instance tag.
type OptionTargetLockDuration ¶
OptionTargetLockDuration wraps time.Duration to be used as an option.