{"repo":"PaesslerAG/gval","free":true,"listed":false,"github":"https://github.com/PaesslerAG/gval","clone":"git clone https://github.com/PaesslerAG/gval.git","description":"Expression evaluation in golang","language":"Go","stars":813,"topics":["evaluate-expressions","expression-evaluator","gval","expression-language","parsing","godoc","evaluation","golang","parser","go"],"license":"BSD-3-Clause","category":"dev-tools","readme_excerpt":"Gval Gval (Go eVALuate) provides support for evaluating arbitrary expressions, in particular Go-like expressions. Evaluate Gval can evaluate expressions with parameters, arimethetic, logical, and string operations: - basic expression: 10 0 - parameterized expression: foo 0 - nested parameterized expression: foo.bar 0 - arithmetic expression: (requests made requests succeeded / 100) = 90 - string expression: http response body == \"service is ok\" - float64 expression: (mem used / total mem) 100 It can easily be extended with custom functions or operators: - custom date comparator: date(\\ 2014-01-02\\ ) date(\\ 2014-01-01 23:59:59\\ ) - string length: strlen(\"someReallyLongInputString\") 0 Bracket Selector Map and array elements and Struct Field can be accessed via [] . - [foo[0]](https://pkg.go.dev/github.com/PaesslerAG/gval/#example-Evaluate-Array) - [foo[\"b\" + \"a\" + \"r\"]](https://pkg.go.dev/github.com/PaesslerAG/gval/#example-Evaluate-ExampleEvaluate ComplexAccessor) Dot Selector A nested variable with a name containing only letters and underscores can be accessed via a dot selector. - foo.bar 0 Custom Selector Parameter names like response-time will be interpreted as response minus time . While gval doesn't support these parameter names directly, you can easily access them via a custom extension like JSON Path: - [$[\"response-time\"]](https://pkg.go.dev/github.com/PaesslerAG/gval/#example-Evaluate-Jsonpath) Jsonpath is also suitable for accessing array elements. Fields and Method","default_branch":null,"files":null,"tree":[],"storefront":"/r/PaesslerAG","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/PaesslerAG/gval/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}