Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

限流的條件不明白 #2

Open
mong0520 opened this issue Mar 25, 2021 · 1 comment
Open

限流的條件不明白 #2

mong0520 opened this issue Mar 25, 2021 · 1 comment

Comments

@mong0520
Copy link

mong0520 commented Mar 25, 2021

這個插件很不錯,學習了。想請問該怎麼理解以下插件的限流條件呢?謝謝
是 header =[orderId1,orderId2,orderId3], or query=[orderId1,orderId2,orderId3] or body=[orderId1,orderId2,orderId3] 則限流嗎?

{
    "type": "header,query,body",
    "key": "orderId",
    "value": "orderId1,orderId2,orderId3"
}
@lampnick
Copy link
Owner

這個插件很不錯,學習了。想請問該怎麼理解以下插件的限流條件呢?謝謝
是 header =[orderId1,orderId2,orderId3], or query=[orderId1,orderId2,orderId3] or body=[orderId1,orderId2,orderId3] 則限流嗎?

{
    "type": "header,query,body",
    "key": "orderId",
    "value": "orderId1,orderId2,orderId3"
}

是的哦,or的关系,但是如果是分开写的话,默认是and关系(Config.MatchCondition string json:"MatchCondition" validate:"omitempty,oneof=and or" //流控规则匹配条件,and:所有规则都需要匹配到则成功,or: 匹配到一个则成功, 为空时默认为and)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants