ignore

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchPattern

func MatchPattern(input, pattern string) bool

MatchPattern checks if the pattern string matches the input pattern. The wildcard '*' in the pattern matches any sequence of characters.

Types

type Ignorer

type Ignorer func(resultMeta types.Metadata, ignoredParam any) bool

Ignorer represents a function that checks if the rule should be ignored.

type Rule

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

Rule represents a rule for ignoring vulnerabilities.

type RuleSectionParser

type RuleSectionParser interface {
	Key() string
	Parse(string) bool
	Param() any
}

RuleSectionParser defines the interface for parsing ignore rules.

type Rules

type Rules []Rule

func Parse

func Parse(src, path, sourcePrefix string, parsers ...RuleSectionParser) Rules

Parse parses the configuration file and returns the Rules

func (Rules) Ignore

func (r Rules) Ignore(m types.Metadata, ids []string, ignorers map[string]Ignorer) bool

Ignore checks if the rule should be ignored based on provided metadata, IDs, and ignorer functions.

type StringMatchParser

type StringMatchParser struct {
	SectionKey string
	// contains filtered or unexported fields
}

func (*StringMatchParser) Key

func (s *StringMatchParser) Key() string

func (*StringMatchParser) Param

func (s *StringMatchParser) Param() any

func (*StringMatchParser) Parse

func (s *StringMatchParser) Parse(str string) bool

Jump to

Keyboard shortcuts

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