job

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 4 Imported by: 0

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

func Tier added in v0.0.7

func Tier() decorate.Tier

Tier is the job decoration tier: recovery outermost, then logging, tracing, metrics, and the per-job timeout. A job runs as the operation "Execute".

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 NewBase added in v0.0.7

func NewBase(deps decorate.Deps) Base

NewBase returns a Base that decorates its jobs with deps.

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) Local added in v0.0.8

func (b Base) Local(
	name, group string,
	fn func(context.Context) (types.StepResults, error),
) interfaces.AnyJob

Local builds the job name in group that runs fn, in-process work (a seeder, a sync) that needs no command runner or root; a gate of Local jobs runs with gate.RunLocal.

func (Base) Wrap added in v0.0.7

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.

Jump to

Keyboard shortcuts

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