analyzer

package
v0.0.0-...-4d495be Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reporter

type Reporter interface {
	GenerateSpecReport(spec *models.Spec, specAnalyses map[analyzer.SpecAnalyzer]*models.SpecAnalysis) (*SpecReport, error)
	GenerateSpecAnalysisReport(spec *models.Spec, specAnalysis *models.SpecAnalysis) (*SpecAnalysisReport, error)
}

func NewReporter

func NewReporter(scoreCfg analyzer.AnalyzersScoreConfigs, analyzers map[analyzer.SpecAnalyzer]*analyzer.Analyzer) (Reporter, error)

type Scorer

type Scorer interface {
	Score(scoreCfg analyzer.AnalyzersScoreConfigs, analyzerRules map[analyzer.SpecAnalyzer]map[rule.SeverityName][]*analyzer.Rule) (int, error)
}

type Service

type Service interface {
	Analyze(req *models.SpecAnalysisRequest) (*models.SpecAnalysisResponse, error)
	Reporter(optionalAnalyzers map[analyzer.SpecAnalyzer]*analyzer.Analyzer) (Reporter, error)
}

func NewService

func NewService(analyzerLister func(ctx context.Context, filter *db.ListFilter, withRules bool) ([]*analyzer.Analyzer, error)) (Service, error)

type SpecAnalysisReport

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

SpecAnalysisReport represents a report of a models.SpecAnalysis.

func NewSpecAnalysisReport

func NewSpecAnalysisReport(specAnalysis *models.SpecAnalysis, spec *models.Spec) *SpecAnalysisReport

func (*SpecAnalysisReport) Score

func (*SpecAnalysisReport) WithMitigation

func (r *SpecAnalysisReport) WithMitigation(analyzerRules map[analyzer.SpecAnalyzer]map[rule.SeverityName][]*analyzer.Rule) *SpecAnalysisReport

func (*SpecAnalysisReport) WithScore

type SpecReport

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

func NewSpecReport

func NewSpecReport(spec *models.Spec, specAnalyses map[analyzer.SpecAnalyzer]*models.SpecAnalysis) *SpecReport

func (*SpecReport) Score

func (r *SpecReport) Score(scoreCfg analyzer.AnalyzersScoreConfigs, analyzerRules map[analyzer.SpecAnalyzer]map[rule.SeverityName][]*analyzer.Rule) (int, error)

func (*SpecReport) WithMitigation

func (r *SpecReport) WithMitigation(analyzerRules map[analyzer.SpecAnalyzer]map[rule.SeverityName][]*analyzer.Rule) *SpecReport

func (*SpecReport) WithScore

func (r *SpecReport) WithScore(scoreCfg analyzer.AnalyzersScoreConfigs, analyzerRules map[analyzer.SpecAnalyzer]map[rule.SeverityName][]*analyzer.Rule) (*SpecReport, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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