Documentation
¶
Overview ¶
Package job builds interfaces.AnyJob values: Base decorates every job it builds with the job tier (recovery, logging, tracing, metrics, timeout) once, so a job is a function plus its name and group, never a hand-written AnyJob type.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base ¶ added in v0.0.7
type Base struct {
// contains filtered or unexported fields
}
Base builds decorated jobs from one set of decoration dependencies. The zero value applies recovery only, so Base{} is a working undecorated builder.
func (Base) Func ¶ added in v0.0.7
func (b Base) Func(name, group string, run Run) interfaces.AnyJob
Func builds the job name in group that runs run.
func (Base) Runnable ¶ added in v0.0.7
func (b Base) Runnable(r interfaces.Runnable) interfaces.AnyJob
Runnable adapts r — a job that needs no runner or root — into a decorated job carrying r's metadata.
func (Base) Wrap ¶ added in v0.0.7
func (b Base) Wrap(j interfaces.AnyJob) interfaces.AnyJob
Wrap decorates an existing job, keeping its metadata.
type Run ¶ added in v0.0.7
type Run func( ctx context.Context, runner interfaces.CommandRunner, root string, ) (types.StepResults, error)
Run is a job's work: it executes against runner under root and returns the job's step results.