istio: Index | Files | Directories

package analysis

import ""


Package Files

analyzer.go context.go metadata.go

type Analyzer Uses

type Analyzer interface {
    Metadata() Metadata
    Analyze(c Context)

Analyzer is an interface for analyzing configuration.

type CombinedAnalyzer Uses

type CombinedAnalyzer struct {
    // contains filtered or unexported fields

CombinedAnalyzer is a special Analyzer that combines multiple analyzers into one

func Combine Uses

func Combine(name string, analyzers ...Analyzer) *CombinedAnalyzer

Combine multiple analyzers into a single one. For input metadata, use the union of the component analyzers

func (*CombinedAnalyzer) Analyze Uses

func (c *CombinedAnalyzer) Analyze(ctx Context)

Analyze implements Analyzer

func (*CombinedAnalyzer) AnalyzerNames Uses

func (c *CombinedAnalyzer) AnalyzerNames() []string

AnalyzerNames returns the names of analyzers in this combined analyzer

func (*CombinedAnalyzer) Metadata Uses

func (c *CombinedAnalyzer) Metadata() Metadata

Metadata implements Analyzer

func (*CombinedAnalyzer) RemoveSkipped Uses

func (c *CombinedAnalyzer) RemoveSkipped(colsInSnapshots, disabledInputs collection.Names, xformProviders transformer.Providers) []string

RemoveSkipped removes analyzers that should be skipped, meaning they meet one of the following criteria: 1. The analyzer requires disabled input collections. The names of removed analyzers are returned. Transformer information is used to determine, based on the disabled input collections, which output collections should be disabled. Any analyzers that require those output collections will be removed. 2. The analyzer requires a collection not available in the current snapshot(s)

type Context Uses

type Context interface {
    // Report a diagnostic message
    Report(c collection.Name, t diag.Message)

    // Find a resource in the collection. If not found, nil is returned
    Find(c collection.Name, name resource.Name) *resource.Entry

    // Exists returns true if the specified resource exists in the context, false otherwise
    Exists(c collection.Name, name resource.Name) bool

    // ForEach iterates over all the entries of a given collection.
    ForEach(c collection.Name, fn IteratorFn)

    // Canceled indicates that the context has been canceled. The analyzer should stop executing as soon as possible.
    Canceled() bool

Context is an analysis context that is passed to individual analyzers.

type IteratorFn Uses

type IteratorFn func(r *resource.Entry) bool

IteratorFn is used to iterate over a set of collection entries. It must return true to keep iterating.

type Metadata Uses

type Metadata struct {
    Name string
    // Description is a short explanation of what the analyzer checks. This
    // field is displayed to users when --list-analyzers is called.
    Description string
    Inputs      collection.Names

Metadata represents metadata for an analyzer



Package analysis imports 5 packages (graph) and is imported by 10 packages. Updated 2019-12-06. Refresh now. Tools for package owners.