ruleset

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MPL-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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