runner

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package runner orchestrates the execution of macnoise telemetry modules. It provides RunSingle for individual module execution, RunMany for sequential batch execution, and RunScenario for YAML-driven multi-step execution. When an audit.Logger is provided in Options, lifecycle records are written for each module run alongside the normal telemetry event stream.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMany

func RunMany(ctx context.Context, gens []module.Generator, params module.Params, emit module.EventEmitter, opts Options) error

RunMany sequentially executes each generator in gens, collecting errors without aborting early.

func RunScenario

func RunScenario(ctx context.Context, path string, emit module.EventEmitter, opts Options) error

RunScenario loads the YAML scenario at path and executes its steps in order.

func RunSingle

func RunSingle(ctx context.Context, gen module.Generator, params module.Params, emit module.EventEmitter, opts Options) error

RunSingle executes one module through its full lifecycle (prereqs → generate → cleanup).

Types

type Options

type Options struct {
	DryRun bool
	// NoCleanup leaves module artifacts in place after Generate. Validation
	// workflows need the installed artifact to persist so the persistence
	// itself can be detected, not just the install event.
	NoCleanup bool
	Timeout   time.Duration
	Verbose   bool
	AuditLog  *audit.Logger
}

Options controls module execution behaviour in RunSingle, RunMany, and RunScenario.

type Scenario

type Scenario struct {
	Name        string         `yaml:"name"`
	Description string         `yaml:"description"`
	AuditLog    string         `yaml:"audit_log,omitempty"`
	Steps       []ScenarioStep `yaml:"steps"`
}

Scenario is the top-level structure parsed from a scenario YAML file.

func LoadScenario

func LoadScenario(path string) (Scenario, error)

LoadScenario reads and parses a YAML scenario file, returning an error if the file has no steps.

type ScenarioStep

type ScenarioStep struct {
	Module   string            `yaml:"module"`
	Category string            `yaml:"category"`
	Params   map[string]string `yaml:"params"`
}

ScenarioStep defines a single module invocation within a scenario.

Jump to

Keyboard shortcuts

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