probe

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package probe checks whether an owed action is done, as of a date.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnknowable means a probe can't answer for the requested date by
	// design, such as a live endpoint during a replay. It isn't a failure.
	ErrUnknowable = source.ErrUnknowable

	// ErrProbe marks a probe that couldn't answer. It's never reported
	// as "not done".
	ErrProbe = errors.New("probe failed")
)

Functions

func Known

func Known(kind string) bool

Known reports whether kind names a probe.

Types

type Context

type Context struct {
	Source     source.Source
	AsOf, Now  time.Time
	Version    string // bound by the trigger; empty for invariants
	Target     config.Component
	Components map[string]config.Component
}

Context is what a probe needs to answer one obligation.

type Result

type Result struct {
	Done     bool
	Evidence string
	Since    time.Time
}

Result is a probe's answer. Since is when the fact became true, for probes that can tell; zero means not known.

func Run

func Run(kind string, spec map[string]any, c *Context) (Result, error)

Run evaluates the probe named kind.

Jump to

Keyboard shortcuts

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