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 3
3
[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/antonmedv/expr )] ( https://goreportcard.com/report/github.com/antonmedv/expr )
4
4
[ ![ GoDoc] ( https://godoc.org/github.com/antonmedv/expr?status.svg )] ( https://godoc.org/github.com/antonmedv/expr )
5
5
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.
11
7
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 " />
15
9
16
10
``` 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
+ ```
22
14
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 )
25
18
```
26
19
27
20
## Features
You can’t perform that action at this time.
0 commit comments