nip

package
v0.0.0-...-9fe14c0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyRule is returned when a rule is empty
	ErrEmptyRule = errors.New("empty rule")
)
View Source
var StatAliases = statAliases
View Source
var TypeAliases = typeAliases

Functions

This section is empty.

Types

type Rule

type Rule struct {
	RawLine    string // Original line, don't use it for evaluation
	Filename   string
	LineNumber int
	Enabled    bool
	// contains filtered or unexported fields
}

func NewRule

func NewRule(rawRule string, filename string, lineNumber int) (Rule, error)

func (Rule) Evaluate

func (r Rule) Evaluate(it data.Item) (RuleResult, error)

func (Rule) MaxQuantity

func (r Rule) MaxQuantity() int

MaxQuantity returns the maximum quantity of items that character can have, 0 means no limit

type RuleResult

type RuleResult int
const (
	RuleResultFullMatch RuleResult = 1
	RuleResultPartial   RuleResult = 2
	RuleResultNoMatch   RuleResult = 3
)

type Rules

type Rules []Rule

func ParseNIPFile

func ParseNIPFile(filePath string) (Rules, error)

func ReadDir

func ReadDir(path string) (Rules, error)

func (Rules) EvaluateAll

func (r Rules) EvaluateAll(it data.Item) (Rule, RuleResult)

Jump to

Keyboard shortcuts

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