gval

package
v0.0.0-...-7101abf Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ExprLanguage is the expression language we use for rules.
	ExprLanguage = gval.Full(gval.VariableSelector(nullSafeSelector))
)

Functions

This section is empty.

Types

type Rule

type Rule struct {
	Filename            string
	FirstLine, LastLine int

	Rule       string
	Expression gval.Evaluable
}

Rule is the description (and parsed Evaluable) of a rule, loaded from a rules file.

func LoadRules

func LoadRules(filename string, language gval.Language) ([]Rule, error)

LoadRules loads rules (specified as gval expressions) from the given file, one expression per line. Empty lines, or lines including comments only, are ignored.

func (*Rule) Location

func (r *Rule) Location() string

Location returns the location in the file where a rule is defined.

Jump to

Keyboard shortcuts

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