function

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eval

func Eval(node *ast.BinaryOperationExpr, args ...interface{}) (interface{}, error)

Eval calculates the result of math expression with custom args.

func EvalCaseWhenFunction

func EvalCaseWhenFunction(node *ast.CaseExpr, args ...interface{}) (interface{}, error)

func EvalCastFunction

func EvalCastFunction(node *ast.FuncCastExpr, args ...interface{}) (interface{}, error)

func EvalFunction

func EvalFunction(node *ast.FuncCallExpr, args ...interface{}) (interface{}, error)

EvalFunction calculates the result of math expression with custom args.

func EvalString

func EvalString(script string, args ...interface{}) (interface{}, error)

EvalString computes the result of given expression script with custom args.

func ReturnJsRuntime

func ReturnJsRuntime(js *JsRuntime)

Types

type JsRuntime

type JsRuntime struct {
	*goja.Runtime
	// contains filtered or unexported fields
}

func BorrowJsRuntime

func BorrowJsRuntime() *JsRuntime

func NewJSRuntime

func NewJSRuntime() *JsRuntime

func (*JsRuntime) Eval

func (js *JsRuntime) Eval(script string, args []interface{}) (interface{}, error)

Jump to

Keyboard shortcuts

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