executor

package
v0.55.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

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

Executor scans HCL blocks by running all registered rules against them

func New

func New(options ...Option) *Executor

New creates a new Executor

func (*Executor) Execute

func (e *Executor) Execute(modules terraform.Modules) (scan.Results, error)

type Job

type Job interface {
	Run() (scan.Results, error)
}

type Option

type Option func(s *Executor)

func OptionWithFrameworks

func OptionWithFrameworks(frameworks ...framework.Framework) Option

func OptionWithIncludeDeprecatedChecks added in v0.55.0

func OptionWithIncludeDeprecatedChecks(b bool) Option

func OptionWithRegoOnly

func OptionWithRegoOnly(regoOnly bool) Option

func OptionWithRegoScanner

func OptionWithRegoScanner(s *rego.Scanner) Option

func OptionWithResultsFilter

func OptionWithResultsFilter(f func(scan.Results) scan.Results) Option

func OptionWithWorkspaceName

func OptionWithWorkspaceName(workspaceName string) Option

type Pool

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

func NewPool

func NewPool(size int, rules []types.RegisteredRule, modules terraform.Modules, st *state.State, regoScanner *rego.Scanner, regoOnly bool) *Pool

func (*Pool) Run

func (p *Pool) Run() (scan.Results, error)

Run runs the job in the pool - this will only return an error if a job panics

type Worker

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

func NewWorker

func NewWorker(incoming <-chan Job) *Worker

func (*Worker) Error

func (w *Worker) Error() error

func (*Worker) Start

func (w *Worker) Start()

func (*Worker) Wait

func (w *Worker) Wait() scan.Results

Jump to

Keyboard shortcuts

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