runner

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 34 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package runner does the work. It takes jobs from its inbox, runs each one's script in a process of its own with the permissions the job was given, and sends back the result.

Index

Constants

View Source
const JobArg = "run-one-job"

JobArg is the argument that makes the binary run one job, as the process a runner starts for it.

Variables

This section is empty.

Functions

func JobMain

func JobMain()

JobMain is the whole of a job's process. It is given the job on the channel from its runner, runs the script, and says how it ended.

Types

type Runner

type Runner struct {
	ID     *identity.Identity
	Serves []Served
	// Trusted, if set, reads afresh at each pass which controllers the
	// runner serves and under what ceiling, from where its trust is kept:
	// a ceiling set again, or a controller removed, holds from the next
	// job.
	Trusted func() ([]Served, error)
	// Jobs is how many jobs are run at once.
	Jobs int
	// Command starts a job's process; by default, this binary.
	Command []string
	// Wrapper is the exec wrapper: a command put in front of every program
	// a job starts.
	Wrapper []string
	// Scratch is where jobs' scratch directories are made.
	Scratch string
	// Now is the runner's clock.
	Now func() time.Time
	// contains filtered or unexported fields
}

A Runner serves the controllers it trusts, each in that controller's store and under the ceiling it gave that controller.

func New

func New(id *identity.Identity, serves ...Served) *Runner

New makes a runner.

func (*Runner) Pass

func (r *Runner) Pass(ctx context.Context) (time.Time, error)

Pass takes every job in the runner's inbox that it can finish and runs it. It does not end while a job it took is still running.

type Served

type Served struct {
	Controller identity.Card
	// Ceiling is the most the runner lets that controller's jobs do.
	Ceiling permission.Layer
	Store   store.Store
}

Served is one controller a runner serves.

Jump to

Keyboard shortcuts

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