matchrule

package
v0.36.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 4 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

This section is empty.

Functions

This section is empty.

Types

type Cond

type Cond byte
const (
	CondAnd Cond = iota
	CondOr
)

func (*Cond) UnmarshalJSON

func (c *Cond) UnmarshalJSON(i []byte) error

type Mode

type Mode byte
const (
	ModePrefix Mode = iota
	ModeContains
	ModeSuffix
)

func (*Mode) UnmarshalJSON

func (m *Mode) UnmarshalJSON(i []byte) error

type Rule

type Rule struct {
	// > @3@4@5@6
	// >
	// > Values to match at least one value.
	Values []string `json:"values" default:"" slice:"true"` // *

	// > @3@4@5@6
	// >
	// > Matching mode. Allowed modes: `prefix`, `contains`, `suffix`. Defaults to `contains`.
	Mode Mode `json:"mode"` // *

	// > @3@4@5@6
	// >
	// > CaseInsensitive is the truth then Match results in a lowercase search value.
	// > Not available fo the ModeContains because performance issues may arise.
	CaseInsensitive bool `json:"case_insensitive"` // *

	// > @3@4@5@6
	// >
	// > Flag indicating whether to negate the result of matching rule.
	Invert bool `json:"invert"` // *
	// contains filtered or unexported fields
}

func (*Rule) Match

func (r *Rule) Match(raw []byte) bool

func (*Rule) Prepare added in v0.14.0

func (r *Rule) Prepare()

type RuleSet

type RuleSet struct {
	// > @3@4@5@6
	// >
	// > Name of the ruleset.
	Name string `json:"name"` // *

	// > @3@4@5@6
	// >
	// > Condition for combining rules. Allowed values: `and`, `or`. Defaults to `and`.
	Cond Cond `json:"cond" default:"and" options:"and|or"` // *

	// > @3@4@5@6
	// >
	// > List of rules to check.
	Rules []Rule `json:"rules" default:"" slice:"true"` // *
}

func (*RuleSet) Match

func (rs *RuleSet) Match(data []byte) bool

func (*RuleSet) Prepare added in v0.14.0

func (rs *RuleSet) Prepare()

type RuleSets added in v0.14.0

type RuleSets []RuleSet

func (RuleSets) Prepare added in v0.14.0

func (rs RuleSets) Prepare()

Jump to

Keyboard shortcuts

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