jobs

package
v0.19.1069 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsJobHandler

func AsJobHandler(group string, f any) any

func Matches

func Matches(job *models.AppRunnerJob, handler JobHandler) error

Types

type JobHandler

type JobHandler interface {
	Name() string

	JobType() models.AppRunnerJobType
	JobStatus() models.AppRunnerJobStatus

	// the following methods are called _in order_ in each handler
	// Fetch fetches the job information from ctlapi and other sources
	Fetch(ctx context.Context, job *models.AppRunnerJob, jobExecution *models.AppRunnerJobExecution) error
	// Initialize ...
	Initialize(ctx context.Context, job *models.AppRunnerJob, jobExecution *models.AppRunnerJobExecution) error
	// Validate validates the input component configs etc
	Validate(ctx context.Context, job *models.AppRunnerJob, jobExecution *models.AppRunnerJobExecution) error
	// Exec executed the actual jon based on the job type
	Exec(ctx context.Context, job *models.AppRunnerJob, jobExecution *models.AppRunnerJobExecution) error
	Cleanup(ctx context.Context, job *models.AppRunnerJob, jobExecution *models.AppRunnerJobExecution) error
	GracefulShutdown(ctx context.Context, job *models.AppRunnerJob, l *zap.Logger) error
	Outputs(ctx context.Context) (map[string]interface{}, error)
}

type StatefulJobHandler

type StatefulJobHandler interface {
	Reset(ctx context.Context) error
}

Directories

Path Synopsis
build
sync

Jump to

Keyboard shortcuts

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