runner

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 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 resolves and invokes default lint/compare plugins by interface type.

Index

Constants

This section is empty.

Variables

View Source
var ErrBudgetExceeded = errors.New("analysis time budget exceeded")

ErrBudgetExceeded is returned (wrapped) when a plugin does not finish within the caller's context deadline.

Functions

This section is empty.

Types

type Action

type Action string

Action identifies a plugin role.

const (
	ActionLint    Action = "lint"
	ActionCompare Action = "compare"
)

type Comparator

type Comparator interface {
	ID() string
	Compare(input contract.CompareInput) (contract.CompareOutput, error)
}

Comparator detects changes between two specifications.

type Linter

type Linter interface {
	ID() string
	Lint(input contract.LintInput) (contract.LintOutput, error)
}

Linter runs quality analysis on a single specification.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry maps interface types to default plugins.

func DefaultRegistry

func DefaultRegistry() *Registry

DefaultRegistry returns the built-in default plugins for each type/action.

func (*Registry) Compare

Compare invokes the default comparator for the input's interface type.

func (*Registry) CompareContext added in v0.0.3

func (r *Registry) CompareContext(ctx context.Context, input contract.CompareInput) (contract.CompareOutput, string, error)

CompareContext is Compare with an overall time budget, like LintContext.

func (*Registry) Lint

Lint invokes the default linter for the input's interface type.

func (*Registry) LintContext added in v0.0.3

func (r *Registry) LintContext(ctx context.Context, input contract.LintInput) (contract.LintOutput, string, error)

LintContext is Lint with an overall time budget: it returns ErrBudgetExceeded as soon as ctx is done. The plugin itself cannot be interrupted; it keeps running in the background until it finishes, bounded by the engine's per-rule timeouts, and its result is discarded.

Jump to

Keyboard shortcuts

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