analyzer

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ET_FilterExpressionMatched = AnalyzerEventType("ev_pkg_filter_match")
	ET_AnalyzerFailOnError     = AnalyzerEventType("ev_fail_on_error")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer interface {
	Name() string

	Analyze(manifest *models.PackageManifest,
		handler AnalyzerEventHandler) error

	Finish() error
}

Contract for an analyzer

func NewCelFilterAnalyzer

func NewCelFilterAnalyzer(fl string, failOnMatch bool) (Analyzer, error)

func NewCelFilterSuiteAnalyzer

func NewCelFilterSuiteAnalyzer(path string, failOnMatch bool) (Analyzer, error)

func NewExceptionsGenerator

func NewExceptionsGenerator(config ExceptionsGeneratorConfig) (Analyzer, error)

func NewJsonDumperAnalyzer

func NewJsonDumperAnalyzer(dir string) (Analyzer, error)

type AnalyzerEvent

type AnalyzerEvent struct {
	// Analyzer generating this event
	Source string

	// Type of the event
	Type AnalyzerEventType

	// Message / Error
	Message interface{}
	Err     error

	// Entities on which event was generated
	Manifest *models.PackageManifest
	Package  *models.Package
}

func (*AnalyzerEvent) IsFailOnError

func (ev *AnalyzerEvent) IsFailOnError() bool

func (*AnalyzerEvent) IsFilterMatch

func (ev *AnalyzerEvent) IsFilterMatch() bool

type AnalyzerEventHandler

type AnalyzerEventHandler func(event *AnalyzerEvent) error

Callback to receive events from analyzer

type AnalyzerEventType

type AnalyzerEventType string

type ExceptionsGeneratorConfig

type ExceptionsGeneratorConfig struct {
	Path      string
	Filter    string
	ExpiresOn string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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