You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by mi...@apache.org on 2021/10/07 06:10:33 UTC

[incubator-shenyu-website] branch match-strategy created (now 13f3574)

This is an automated email from the ASF dual-hosted git repository.

midnight2104 pushed a change to branch match-strategy
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git.


      at 13f3574  update english selector-and-rule.md, add match strategy .

This branch includes the following new commits:

     new 13f3574  update english selector-and-rule.md, add match strategy .

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[incubator-shenyu-website] 01/01: update english selector-and-rule.md, add match strategy .

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

midnight2104 pushed a commit to branch match-strategy
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git

commit 13f35747297515e60add398d652f5d0e44a9ffc7
Author: midnight2104 <LL...@163.com>
AuthorDate: Thu Oct 7 14:10:05 2021 +0800

    update english selector-and-rule.md, add match strategy .
---
 docs/user-guide/admin-usage/selector-and-rule.md   |  29 +++++++++++++++++++++
 .../user-guide/admin-usage/selector-and-rule.md    |  25 ++++++++++++++++++
 .../user-guide/admin-usage/selector-and-rule.md    |  26 ++++++++++++++++++
 .../selectorRule/match-strategy-and-en.png         | Bin 0 -> 78437 bytes
 .../selectorRule/match-strategy-and-zh.png         | Bin 0 -> 82923 bytes
 .../selectorRule/match-strategy-or-en.png          | Bin 0 -> 77977 bytes
 .../selectorRule/match-strategy-or-zh.png          | Bin 0 -> 82466 bytes
 .../user-guide/admin-usage/selector-and-rule.md    |  29 +++++++++++++++++++++
 8 files changed, 109 insertions(+)

diff --git a/docs/user-guide/admin-usage/selector-and-rule.md b/docs/user-guide/admin-usage/selector-and-rule.md
index abc3d2d..48e9b5d 100644
--- a/docs/user-guide/admin-usage/selector-and-rule.md
+++ b/docs/user-guide/admin-usage/selector-and-rule.md
@@ -104,6 +104,35 @@ For example, add a selector to the `divide` plugin:
 * combine selector means :when the request `uri` is `/http/order/save`, it will be redicted to `127.0.0.1:8080` by `random` method.
 
 
+## Match Strategy
+
+Matching mode refers to the matching mode between multiple conditions when a selector or rule is matched. Currently, `and` and `or` are supported.
+
+
+* `and`
+
+  `and` indicates that a selector or rule can be matched only if more than one condition is met.
+
+  The example below shows that a request must meet both the condition `uri = /http/order/findById` and the condition `id = 100`  to match this rule.
+
+  For example, a real request `http://localhost:9195/http/order/findById?id=100` satisfies both conditions, this rule can be matched.
+
+
+![](/img/shenyu/basicConfig/selectorRule/match-strategy-and-en.png)
+
+
+* `or`
+
+  `or` indicates that one of the conditions matches a selector or rule.
+
+  The example below shows that a request matches this rule if it meets either the condition `uri = /http/order/findById` or the condition `id = 100`.
+
+  For example, a real request `http://localhost:9195/http/order/findById?id=99` satisfies the first condition `uri = /http/order/findById`, so it can also match this rule.
+
+
+![](/img/shenyu/basicConfig/selectorRule/match-strategy-or-en.png)
+
+
 ## Condition Parameter Data
 
 Conditional parameter Settings in selectors and rules are explained again. Suppose the following is a request header for an `Http` request:
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/admin-usage/selector-and-rule.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/admin-usage/selector-and-rule.md
index 96de289..b5d8728 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/admin-usage/selector-and-rule.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/admin-usage/selector-and-rule.md
@@ -94,6 +94,31 @@ description: 选择器和规则管理
 
 联合选择器,我们来表述一下:当一个请求的 `uri` 为 `/http/order/save`,会通过 `random` 的方式,转发到 `127.0.0.1:8080` 机器上。
 
+## 匹配方式
+
+匹配方式是指在选择器或规则匹配时,多个条件之间的匹配方式,当前支持 `and` 和 `or`。
+
+* `and`
+
+  `and`表示多个条件同时满足才能匹配上选择器或规则。
+
+  下图中的示例表示,请求必须同时满足条件 `uri = /http/order/findById` 和 条件 `id = 100` 才能匹配上该条规则。
+
+  比如一个真实的请求 `http://localhost:9195/http/order/findById?id=100` 能够同时满足上述两个条件,所以可以匹配上该条规则。
+
+![](/img/shenyu/basicConfig/selectorRule/match-strategy-and-zh.png)
+
+
+* `or`
+
+  `or`表示多个条件中满足一个就能匹配上选择器或规则。
+
+  下图中的示例表示,请求满足条件 `uri = /http/order/findById` 或者 条件 `id = 100` 就能匹配上该条规则。
+
+  比如一个真实的请求 `http://localhost:9195/http/order/findById?id=99` 能够满足上述第一个条件 `uri = /http/order/findById`,所以也可以匹配上该条规则。
+
+![](/img/shenyu/basicConfig/selectorRule/match-strategy-or-zh.png)
+
 ## 条件参数
 
 对选择器和规则中的条件参数设置再次进行解释。假如下面是一个 `HTTP` 请求的请求头:
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/user-guide/admin-usage/selector-and-rule.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/user-guide/admin-usage/selector-and-rule.md
index dbc9a03..25cfb7f 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/user-guide/admin-usage/selector-and-rule.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/user-guide/admin-usage/selector-and-rule.md
@@ -94,6 +94,32 @@ description: 选择器和规则管理
 
 联合选择器,我们来表述一下:当一个请求的 `uri` 为 `/http/order/save`,会通过 `random` 的方式,转发到 `127.0.0.1:8080` 机器上。
 
+## 匹配方式
+
+匹配方式是指在选择器或规则匹配时,多个条件之间的匹配方式,当前支持 `and` 和 `or`。
+
+* `and`
+ 
+   `and`表示多个条件同时满足才能匹配上选择器或规则。
+  
+   下图中的示例表示,请求必须同时满足条件 `uri = /http/order/findById` 和 条件 `id = 100` 才能匹配上该条规则。
+  
+   比如一个真实的请求 `http://localhost:9195/http/order/findById?id=100` 能够同时满足上述两个条件,所以可以匹配上该条规则。
+
+![](/img/shenyu/basicConfig/selectorRule/match-strategy-and-zh.png)
+
+
+* `or`
+ 
+  `or`表示多个条件中满足一个就能匹配上选择器或规则。
+
+  下图中的示例表示,请求满足条件 `uri = /http/order/findById` 或者 条件 `id = 100` 就能匹配上该条规则。
+  
+  比如一个真实的请求 `http://localhost:9195/http/order/findById?id=99` 能够满足上述第一个条件 `uri = /http/order/findById`,所以也可以匹配上该条规则。
+
+![](/img/shenyu/basicConfig/selectorRule/match-strategy-or-zh.png)
+
+
 ## 条件参数
 
 对选择器和规则中的条件参数设置再次进行解释。假如下面是一个 `HTTP` 请求的请求头:
diff --git a/static/img/shenyu/basicConfig/selectorRule/match-strategy-and-en.png b/static/img/shenyu/basicConfig/selectorRule/match-strategy-and-en.png
new file mode 100644
index 0000000..439732d
Binary files /dev/null and b/static/img/shenyu/basicConfig/selectorRule/match-strategy-and-en.png differ
diff --git a/static/img/shenyu/basicConfig/selectorRule/match-strategy-and-zh.png b/static/img/shenyu/basicConfig/selectorRule/match-strategy-and-zh.png
new file mode 100644
index 0000000..475155a
Binary files /dev/null and b/static/img/shenyu/basicConfig/selectorRule/match-strategy-and-zh.png differ
diff --git a/static/img/shenyu/basicConfig/selectorRule/match-strategy-or-en.png b/static/img/shenyu/basicConfig/selectorRule/match-strategy-or-en.png
new file mode 100644
index 0000000..878fd85
Binary files /dev/null and b/static/img/shenyu/basicConfig/selectorRule/match-strategy-or-en.png differ
diff --git a/static/img/shenyu/basicConfig/selectorRule/match-strategy-or-zh.png b/static/img/shenyu/basicConfig/selectorRule/match-strategy-or-zh.png
new file mode 100644
index 0000000..c9fc1fe
Binary files /dev/null and b/static/img/shenyu/basicConfig/selectorRule/match-strategy-or-zh.png differ
diff --git a/versioned_docs/version-2.4.0/user-guide/admin-usage/selector-and-rule.md b/versioned_docs/version-2.4.0/user-guide/admin-usage/selector-and-rule.md
index 46c376e..c966fcc 100644
--- a/versioned_docs/version-2.4.0/user-guide/admin-usage/selector-and-rule.md
+++ b/versioned_docs/version-2.4.0/user-guide/admin-usage/selector-and-rule.md
@@ -104,6 +104,35 @@ For example, add a selector to the `divide` plugin:
 * combine selector means :when the request `uri` is `/http/order/save`, it will be redicted to `127.0.0.1:8080` by `random` method.
 
 
+## Match Strategy
+
+Matching mode refers to the matching mode between multiple conditions when a selector or rule is matched. Currently, `and` and `or` are supported.
+
+
+* `and`
+
+  `and` indicates that a selector or rule can be matched only if more than one condition is met.
+
+  The example below shows that a request must meet both the condition `uri = /http/order/findById` and the condition `id = 100`  to match this rule.
+
+  For example, a real request `http://localhost:9195/http/order/findById?id=100` satisfies both conditions, this rule can be matched.
+
+
+![](/img/shenyu/basicConfig/selectorRule/match-strategy-and-en.png)
+
+
+* `or`
+
+  `or` indicates that one of the conditions matches a selector or rule.
+
+  The example below shows that a request matches this rule if it meets either the condition `uri = /http/order/findById` or the condition `id = 100`.
+
+  For example, a real request `http://localhost:9195/http/order/findById?id=99` satisfies the first condition `uri = /http/order/findById`, so it can also match this rule.
+
+
+![](/img/shenyu/basicConfig/selectorRule/match-strategy-or-en.png)
+
+
 ## Condition Parameter Data
 
 Conditional parameter Settings in selectors and rules are explained again. Suppose the following is a request header for an `Http` request: