match

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Match

type Match struct {
	Type          Type                        // The kind of match made (an exact match, fuzzy match, indirect vs direct, etc).
	Confidence    float64                     // The certainty of the match as a ratio (currently unused, reserved for future use).
	Vulnerability vulnerability.Vulnerability // The vulnerability details of the match.
	Package       pkg.Package                 // The package used to search for a match.
	SearchKey     map[string]interface{}      // The specific attributes that were used to search (other than package name and version) --this indicates "how" the match was made.
	SearchMatches map[string]interface{}      // The specific attributes on the vulnerability object that were matched with --this indicates "what" was matched on / within.
	Matcher       MatcherType                 // The matcher object that discovered the match.
}

Match represents a finding in the vulnerability matching process, pairing a single package and a single vulnerability object.

func (Match) String

func (m Match) String() string

String is the string representation of select match fields.

func (Match) Summary

func (m Match) Summary() string

Summary is a short string representation of the match object.

type MatcherType

type MatcherType int
const (
	UnknownMatcherType MatcherType = iota
	ApkMatcher
	RubyGemMatcher
	DpkgMatcher
	RpmDBMatcher
	JavaMatcher
	PythonMatcher
	JavascriptMatcher
	MsrcMatcher
)

func (MatcherType) String

func (f MatcherType) String() string

type Matches

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

func NewMatches

func NewMatches() Matches

func (*Matches) Add

func (r *Matches) Add(p pkg.Package, matches ...Match)

func (*Matches) Count

func (r *Matches) Count() int

Count returns the total number of matches in a result

func (*Matches) Enumerate

func (r *Matches) Enumerate() <-chan Match

func (*Matches) GetByPkgID

func (r *Matches) GetByPkgID(id pkg.ID) []Match

GetByPkgID returns a slice of potential matches from an ID

func (*Matches) Merge

func (r *Matches) Merge(other Matches)

func (*Matches) Sorted added in v0.12.1

func (r *Matches) Sorted() []Match

type Type

type Type int
const (
	UnknownMatchType Type = iota
	ExactDirectMatch
	ExactIndirectMatch
	FuzzyMatch
)

func ParseType

func ParseType(userStr string) Type

func (Type) String

func (f Type) String() string

Jump to

Keyboard shortcuts

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