Help us shape the future of Go! Take the 2026 Go Developer Survey

job

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 1 Imported by: 0

README

bootstrap/job

A job is a function an app runs once and then exits, the shape of a Kubernetes CronJob:

// Handler is the work of a job.
type Handler func(ctx context.Context) error

It returns when the work is done, with the error that makes the app exit non-zero, or when ctx is cancelled because the app is stopping (SIGTERM). fx/modules/bootstrap/job runs it; builder generates the app from @Job:

// Run checks the stock of the configured items.
// @Job(app=stock-audit)
func (a *Auditor) Run(ctx context.Context) error { ... }

Documentation

Overview

Package job is a function an app runs once and then exits, the shape of a Kubernetes CronJob. fx/modules/bootstrap/job runs it; builder generates the app from @Job.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(ctx context.Context) error

Handler is the work of a job. It returns when the work is done, with the error that makes the app exit non-zero, or when ctx is cancelled because the app is stopping (SIGTERM).

Jump to

Keyboard shortcuts

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