expressions

package
v0.0.0-...-881b546 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExprType

type ExprType string
const (
	Format     ExprType = "Format"
	GoTemplate ExprType = "GoTemplate"
	Regex      ExprType = "Regex"
	Glob       ExprType = "Glob"
)

func FromString

func FromString(exprType string) (ExprType, error)

type Expression

type Expression struct {
	// contains filtered or unexported fields
}

func NewExpression

func NewExpression(exprType ExprType, expression string) *Expression

func NewFromConfig

func NewFromConfig(expr configs.Expression) (*Expression, error)

func (*Expression) EvalGoTemplate

func (e *Expression) EvalGoTemplate(input map[string]string) (string, error)

func (*Expression) EvalStringFormat

func (e *Expression) EvalStringFormat(inputs ...interface{}) string

func (*Expression) MatchEvaluate

func (e *Expression) MatchEvaluate(inputMap map[string]string, lineInput string) (bool, error)

func (*Expression) MatchGlob

func (e *Expression) MatchGlob(input string) bool

func (*Expression) MatchGoTemplate

func (e *Expression) MatchGoTemplate(input map[string]string) (bool, error)

func (*Expression) MatchRegex

func (e *Expression) MatchRegex(input string) (bool, error)

func (*Expression) StringEvaluate

func (e *Expression) StringEvaluate(inputMap map[string]string, inputs []interface{}) (string, error)

Jump to

Keyboard shortcuts

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