executor

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package executor is the thing that will execute our rules.

This means processing the rules, one by one, but also ensuring dependencies are handled.

Variable assignments, and the inclusion of files, occur at run-time too, so they are handled here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct {

	// Program is the series of AST-nodes we'll interpret.
	Program []ast.Node
	// contains filtered or unexported fields
}

Executor holds our internal state.

func New

func New(program []ast.Node) *Executor

New creates a new executor, using the array of AST nodes we should execute, which was produced by the parser.

func (*Executor) Check

func (e *Executor) Check() error

Check ensures the rules make sense.

In short this means that we check the dependencies/notifiers listed for every rule, and raise an error if they contain references to rules which don't exist.

func (*Executor) Execute

func (e *Executor) Execute() error

Execute runs the rules in turn, handling any dependency ordering.

func (*Executor) MarkSeen added in v0.11.0

func (e *Executor) MarkSeen(path string)

MarkSeen marks the given file as having already been seen.

func (*Executor) SetConfig added in v0.6.0

func (e *Executor) SetConfig(cfg *config.Config)

SetConfig updates the executor with the specified configuration object.

func (*Executor) SetMagicIncludeVars added in v0.12.0

func (e *Executor) SetMagicIncludeVars(path string) error

SetMagicIncludeVars sets magic environment variables.

Jump to

Keyboard shortcuts

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