ruleset

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoIncludeRules = errors.New("no include rules specified")

Functions

This section is empty.

Types

type RegexpListItem

type RegexpListItem struct {
	*regexp.Regexp
	Exclude bool
}

func ParseRegexpListItem

func ParseRegexpListItem(val string) (RegexpListItem, error)

func (RegexpListItem) String

func (r RegexpListItem) String() string

type RegexpMatcher

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

func NewRegexpMatcher

func NewRegexpMatcher(include, exclude []*regexp.Regexp) (*RegexpMatcher, error)

NewRegexpMatcher returns the RegexpMatcher with given include and exclude rules.

func NewRegexpMatcherFromList

func NewRegexpMatcherFromList(l []RegexpListItem) (*RegexpMatcher, error)

func (*RegexpMatcher) Inverse

func (r *RegexpMatcher) Inverse() *RegexpMatcher

Inverse returns a new RegexpMatcher that inverts the match result.

func (*RegexpMatcher) Match

func (r *RegexpMatcher) Match(s string) bool

Match returns true if the given string matches at least one of the include rules and does not match the exclude rules.

Jump to

Keyboard shortcuts

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