Skip to content

Commit

Permalink
Bump conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzhuojie committed Feb 13, 2019
1 parent 4be2291 commit cc81e98
Show file tree
Hide file tree
Showing 9 changed files with 280 additions and 57 deletions.
267 changes: 240 additions & 27 deletions Gopkg.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@
name = "github.com/yadvendar/negroni-newrelic-go-agent"

[[constraint]]
branch = "master"
name = "github.com/zhouzhuojie/conditions"
version = "0.2.2"

[[constraint]]
branch = "master"
Expand All @@ -157,11 +157,11 @@
name = "github.com/avast/retry-go"
version = "2.2.0"

[[constraint]]
name = "cloud.google.com/go"
version = "0.35.1"


[prune]
go-tests = true
unused-packages = true

[[constraint]]
name = "cloud.google.com/go"
version = "0.35.1"
5 changes: 2 additions & 3 deletions benchmark/postEvaluation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"entityID": "123",
"entityType": "report",
"entityContext": {
"dl_state": "CA"
"state": "1234"
},
"flagID": 2,
"enableDebug": true
"flagID": 1
}
Binary file modified benchmark/postEvaluation.output
Binary file not shown.
2 changes: 1 addition & 1 deletion benchmark/postEvaluation.target
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
POST http://localhost:18000/api/evaluation
POST http://localhost:18000/api/v1/evaluation
Content-Type: application/json
7 changes: 5 additions & 2 deletions pkg/handler/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ var evalSegment = func(
}
if !match {
log = &models.SegmentDebugLog{
Msg: debugConstraintMsg(expr, m),
Msg: debugConstraintMsg(evalContext.EnableDebug, expr, m),
SegmentID: int64(segment.ID),
}
return nil, log, true
Expand All @@ -252,7 +252,10 @@ var evalSegment = func(
return vID, log, false
}

func debugConstraintMsg(expr conditions.Expr, m map[string]interface{}) string {
func debugConstraintMsg(enableDebug bool, expr conditions.Expr, m map[string]interface{}) string {
if !enableDebug {
return ""
}
return fmt.Sprintf("constraint not match. constraint: %s, entity_context: %+v.", expr, m)
}

Expand Down
11 changes: 11 additions & 0 deletions vendor/github.com/zhouzhuojie/conditions/ast.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 14 additions & 18 deletions vendor/github.com/zhouzhuojie/conditions/evaluator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/github.com/zhouzhuojie/conditions/parser.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cc81e98

Please sign in to comment.