Documentation
¶
Overview ¶
Package runner resolves and invokes default lint/compare plugins by interface type.
Index ¶
- Variables
- type Action
- type Comparator
- type Linter
- type Registry
- func (r *Registry) Compare(input contract.CompareInput) (contract.CompareOutput, string, error)
- func (r *Registry) CompareContext(ctx context.Context, input contract.CompareInput) (contract.CompareOutput, string, error)
- func (r *Registry) Lint(input contract.LintInput) (contract.LintOutput, string, error)
- func (r *Registry) LintContext(ctx context.Context, input contract.LintInput) (contract.LintOutput, string, error)
Constants ¶
This section is empty.
Variables ¶
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 Comparator ¶
type Comparator interface {
ID() string
Compare(input contract.CompareInput) (contract.CompareOutput, error)
}
Comparator detects changes between two specifications.
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 ¶
func (r *Registry) Compare(input contract.CompareInput) (contract.CompareOutput, string, error)
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) 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.