ruleset

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MPL-2.0 Imports: 6 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.

type TimeFrameEntry added in v1.6.0

type TimeFrameEntry struct {
	Weekday   time.Weekday // Weekday is 0-6, going from Sunday to Saturday
	HourStart int          // 24h system
	HourEnd   int          // 24h system
}

func ParseTimeFrameEntry added in v1.6.0

func ParseTimeFrameEntry(repr string) (TimeFrameEntry, error)

func (*TimeFrameEntry) Match added in v1.6.0

func (t *TimeFrameEntry) Match(timeToMatch time.Time) bool

func (*TimeFrameEntry) Validate added in v1.6.0

func (t *TimeFrameEntry) Validate() error

Jump to

Keyboard shortcuts

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