dsl

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 21 Imported by: 56

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultHelperFunctions map[string]govaluate.ExpressionFunction
View Source
var ErrInvalidDslFunction = errors.New("invalid DSL function signature")
View Source
var (
	RegexStore = make(map[string]*regexp.Regexp)
)

Functions

func EvalExpr

func EvalExpr(expr string, vars map[string]interface{}) (interface{}, error)

func GetPrintableDslFunctionSignatures

func GetPrintableDslFunctionSignatures(noColor bool) string

func RandSeq

func RandSeq(base string, n int) string

func Regex

func Regex(regxp string) (*regexp.Regexp, error)

func TrimAll

func TrimAll(s, cutset string) string

Types

type Engine

type Engine struct {
	HelperFunctions map[string]govaluate.ExpressionFunction
	ExpressionStore map[string]*govaluate.EvaluableExpression
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine() (*Engine, error)

func (*Engine) EvalExpr

func (e *Engine) EvalExpr(expr string, vars map[string]interface{}) (interface{}, error)

func (*Engine) EvalExprFromCache

func (e *Engine) EvalExprFromCache(expr string, vars map[string]interface{}) (interface{}, error)

Jump to

Keyboard shortcuts

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