File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change 33[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/antonmedv/expr )] ( https://goreportcard.com/report/github.com/antonmedv/expr )
44[ ![ GoDoc] ( https://godoc.org/github.com/antonmedv/expr?status.svg )] ( https://godoc.org/github.com/antonmedv/expr )
55
6- <img src =" https://expr.medv.io/img/logo-small.png " width =" 150 " alt =" expr logo " align =" right " />
7-
8- ** Expr** package provides an engine that can compile and evaluate expressions.
9- An expression is a one-liner that returns a value (mostly, but not limited to, booleans).
10- It is designed for simplicity, speed and safety.
6+ ** Expr** is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
117
12- The purpose of the package is to allow users to use expressions inside configuration for more complex logic.
13- It is a perfect candidate for the foundation of a _ business rule engine_ .
14- The idea is to let configure things in a dynamic way without recompile of a program:
8+ <img src =" https://expr.medv.io/img/logo-small.png " width =" 150 " alt =" expr logo " align =" right " />
159
1610``` js
17- // Get the special price if
18- user .Group in [" good_customers" , " collaborator" ]
19-
20- // Promote article to the homepage when
21- len (article .Comments ) > 100 and article .Category not in [" misc" ]
11+ // Allow only admins and moderators to moderate comments.
12+ user .Group in [" admin" , " moderator" ] || user .Id == comment .UserId
13+ ```
2214
23- // Send an alert when
24- product .Stock < 15
15+ ``` js
16+ // Ensure all tweets are less than 240 characters.
17+ all (Tweets, .Size <= 240 )
2518```
2619
2720## Features
You can’t perform that action at this time.
0 commit comments