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/08/30 13:19:59 UTC
[incubator-shenyu-website] branch dev updated (6342a3c -> 6b1e9b6)
This is an automated email from the ASF dual-hosted git repository.
midnight2104 pushed a change to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git.
from 6342a3c resolve conflict
new cdd7e92 update custom match mode doc.
add 74718aa add client property config doc (#210)
add e7a9b75 feat: deployment-k8s doc (#211)
add e6e3ebc Update index.md (#213)
add 6bebee1 add english documents of 2.4.0 News (#212)
new 6b1e9b6 Merge branch 'main' into dev
The 2 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.
Summary of changes:
content/en/news/shenyu-2.4.0/index.md | 392 +++++++++++++++++
content/en/projects/shenyu/_index.md | 10 +-
.../shenyu/custom-condition-match/index.md | 74 ----
.../en/projects/shenyu/custom-match-mode/index.md | 72 ++++
content/en/projects/shenyu/deployment-k8s/index.md | 474 ++++++++++++++++++++
content/zh/projects/shenyu/_index.md | 10 +
.../shenyu/custom-condition-match/index.md | 74 ----
.../zh/projects/shenyu/custom-match-mode/index.md | 69 +++
content/zh/projects/shenyu/custom-result/index.md | 2 +-
content/zh/projects/shenyu/deployment-k8s/index.md | 477 +++++++++++++++++++++
static/img/community/admin-permission-en.jpg | Bin 0 -> 260857 bytes
static/img/community/admin_homepage_en.jpg | Bin 0 -> 228788 bytes
.../shenyu/custom/custom-condition-match-en.png | Bin 292248 -> 0 bytes
.../shenyu/custom/custom-condition-match-zh.png | Bin 21903 -> 0 bytes
.../img/shenyu/custom/custom_match_strategy_en.png | Bin 0 -> 115698 bytes
.../img/shenyu/custom/custom_match_strategy_zh.png | Bin 0 -> 114601 bytes
.../shenyu/custom/use_custom_match_strategy_en.png | Bin 0 -> 65226 bytes
.../shenyu/custom/use_custom_match_strategy_zh.png | Bin 0 -> 69796 bytes
.../img/shenyu/plugin/plugin-chain-execute-en.jpg | Bin 0 -> 121808 bytes
19 files changed, 1502 insertions(+), 152 deletions(-)
create mode 100644 content/en/news/shenyu-2.4.0/index.md
delete mode 100644 content/en/projects/shenyu/custom-condition-match/index.md
create mode 100644 content/en/projects/shenyu/custom-match-mode/index.md
delete mode 100644 content/zh/projects/shenyu/custom-condition-match/index.md
create mode 100644 content/zh/projects/shenyu/custom-match-mode/index.md
create mode 100644 static/img/community/admin-permission-en.jpg
create mode 100644 static/img/community/admin_homepage_en.jpg
delete mode 100644 static/img/shenyu/custom/custom-condition-match-en.png
delete mode 100644 static/img/shenyu/custom/custom-condition-match-zh.png
create mode 100644 static/img/shenyu/custom/custom_match_strategy_en.png
create mode 100644 static/img/shenyu/custom/custom_match_strategy_zh.png
create mode 100644 static/img/shenyu/custom/use_custom_match_strategy_en.png
create mode 100644 static/img/shenyu/custom/use_custom_match_strategy_zh.png
create mode 100644 static/img/shenyu/plugin/plugin-chain-execute-en.jpg
[incubator-shenyu-website] 02/02: Merge branch 'main' into dev
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
midnight2104 pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git
commit 6b1e9b6ae67d28578b8b18df4de31f990623d40d
Merge: cdd7e92 6bebee1
Author: midnight2104 <LL...@163.com>
AuthorDate: Mon Aug 30 21:18:52 2021 +0800
Merge branch 'main' into dev
content/en/news/shenyu-2.4.0/index.md | 392 +++++++++++++++++
content/en/projects/shenyu/deployment-k8s/index.md | 474 ++++++++++++++++++++
content/zh/projects/shenyu/custom-result/index.md | 2 +-
content/zh/projects/shenyu/deployment-k8s/index.md | 477 +++++++++++++++++++++
static/img/community/admin-permission-en.jpg | Bin 0 -> 260857 bytes
static/img/community/admin_homepage_en.jpg | Bin 0 -> 228788 bytes
.../img/shenyu/plugin/plugin-chain-execute-en.jpg | Bin 0 -> 121808 bytes
7 files changed, 1344 insertions(+), 1 deletion(-)
[incubator-shenyu-website] 01/02: update custom match mode doc.
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
midnight2104 pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git
commit cdd7e92bc5dcdbc001400a0ae67d93e7caec6afb
Author: midnight2104 <LL...@163.com>
AuthorDate: Mon Aug 30 21:18:08 2021 +0800
update custom match mode doc.
---
content/en/projects/shenyu/_index.md | 10 ++-
.../shenyu/custom-condition-match/index.md | 74 ---------------------
.../en/projects/shenyu/custom-match-mode/index.md | 72 ++++++++++++++++++++
content/zh/projects/shenyu/_index.md | 10 +++
.../shenyu/custom-condition-match/index.md | 74 ---------------------
.../zh/projects/shenyu/custom-match-mode/index.md | 69 +++++++++++++++++++
.../shenyu/custom/custom-condition-match-en.png | Bin 292248 -> 0 bytes
.../shenyu/custom/custom-condition-match-zh.png | Bin 21903 -> 0 bytes
.../img/shenyu/custom/custom_match_strategy_en.png | Bin 0 -> 115698 bytes
.../img/shenyu/custom/custom_match_strategy_zh.png | Bin 0 -> 114601 bytes
.../shenyu/custom/use_custom_match_strategy_en.png | Bin 0 -> 65226 bytes
.../shenyu/custom/use_custom_match_strategy_zh.png | Bin 0 -> 69796 bytes
12 files changed, 158 insertions(+), 151 deletions(-)
diff --git a/content/en/projects/shenyu/_index.md b/content/en/projects/shenyu/_index.md
index f2d9eaa..df586ed 100644
--- a/content/en/projects/shenyu/_index.md
+++ b/content/en/projects/shenyu/_index.md
@@ -192,10 +192,14 @@ sidebar:
link: 'thread'
- title: 'Shenyu Optimize'
link: 'shenyu-optimize'
- - title: 'SPI'
+ - title: 'Custom SPI'
sub:
- - title: 'Custom Condition Match'
- link: 'custom-condition-match'
+ - title: 'Custom Match Mode'
+ link: 'custom-match-mode'
+ - title: 'Custom Parameter Data'
+ link: 'custom-parameter-data'
+ - title: 'Custom Predicate Judge'
+ link: 'custom-predicate-judge'
- title: 'Release Notes'
link: 'release-notes'
- title: 'Download'
diff --git a/content/en/projects/shenyu/custom-condition-match/index.md b/content/en/projects/shenyu/custom-condition-match/index.md
deleted file mode 100644
index 7277952..0000000
--- a/content/en/projects/shenyu/custom-condition-match/index.md
+++ /dev/null
@@ -1,74 +0,0 @@
----
-title: Custom Condition Match
-keywords: Apache ShenYu
-description: custom condition match
----
-
-
-## Explanation
-
-* Before custom development, please customize and build the gateway environment first, please refer to: [custom deployment](../deployment-custom)
-
-* This article describes how to customize the extension of `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`.
-
-## Extension
-
-* Create a new class `${you class}`,implements `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`
-
-```
-public class ${you class} implements MatchStrategy {
-
- @Override
- public Boolean match(final List<ConditionData> conditionDataList, final ServerWebExchange exchange) {
- //coding and return
- return true;
- }
-}
-```
-
-* In the project `resources` directory,Create a new `META-INF/shenyu` directory, and the new file name is : `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`.
-add `${you spi name}` = `${you class path}`:
-
-```
-${you spi name} = ${you class path}
-```
-
-* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the dictionary code as `MATCH_MODE`, add a new piece of data, pay attention to the dictionary name: `${you spi name}`.
-
-<img src="/img/shenyu/custom/custom-condition-match-en.png" width="40%" height="30%" />
-
-* Or execute the following custom `SQL` statement:
-
-```sql
-INSERT IGNORE INTO `shenyu_dict` (
- `id`,
- `type`,
- `dict_code`,
- `dict_name`,
- `dict_value`,
- `desc`,
- `sort`,
- `enabled`,
- `date_created`,
- `date_updated`
- )
-VALUES (
- 'you id',
- 'matchMode',
- 'MATCH_MODE',
- 'you spi name',
- 'you value',
- 'you spi name',
- 0,
- 1,
- '2021-05-30 19:29:10',
- '2021-05-30 20:15:23'
- );
-```
-
-
-
-
-
-
-
diff --git a/content/en/projects/shenyu/custom-match-mode/index.md b/content/en/projects/shenyu/custom-match-mode/index.md
new file mode 100644
index 0000000..33360eb
--- /dev/null
+++ b/content/en/projects/shenyu/custom-match-mode/index.md
@@ -0,0 +1,72 @@
+---
+title: Custom Match Mode
+keywords: Apache ShenYu
+description: custom match mode
+---
+
+
+## Explanation
+
+* Before custom development, please customize and build the gateway environment first, please refer to: [custom deployment](../deployment-custom) .
+
+* This article describes how to customize the extension of `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`.
+
+## Extension
+
+* Create a new class `CustomMatchStrategy`, extends `org.apache.shenyu.plugin.base.condition.strategy.AbstractMatchStrategy`, implements `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`, add annotation `org.apache.shenyu.spi.Join`.
+
+```java
+/**
+ * This is custom match strategy.
+ */
+@Join
+public class CustomMatchStrategy extends AbstractMatchStrategy implements MatchStrategy {
+
+ @Override
+ public Boolean match(final List<ConditionData> conditionDataList, final ServerWebExchange exchange) {
+ // custom match strategy
+ }
+}
+```
+
+* In the project `resources` directory, create a new `META-INF/shenyu` directory, and the new file name is : `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`.
+add key-value as following:
+
+```shell script
+${spi name} = ${custom class path}
+```
+
+`${spi name}` represents the name of `spi` and `${custom class path}` represents the fully qualified name of the class. Such as:
+
+
+```shell script
+custom = org.apache.shenyu.examples.http.strategy.CustomMatchStrategy
+```
+
+* In the `Apache ShenYu` gateway management system --> BasicConfig --> Dictionary, find the dictionary code as `MATCH_MODE`, add a new piece of data, pay attention to the dictionary name: `${spi name}`.
+
+<img src="/img/shenyu/custom/custom_match_strategy_en.png" width="70%" height="60%" />
+
+ > DictionaryType: `matchMode`;
+>
+ > DictionaryCode: `MATCH_MODE`;
+>
+ > DictionaryName: `${spi name}`, input your custom spi name;
+>
+ > DictionaryValue: When used, the value of the drop-down box, do not repeat with the existing;
+
+> DictionaryDescribe: desc your custom match strategy;
+>
+ > Sort: to sort;
+>
+ > Status: open or close.
+
+
+
+
+* When adding selectors or rules, you can use custom MatchType:
+
+
+<img src="/img/shenyu/custom/use_custom_match_strategy_en.png" width="80%" height="70%" />
+
+
diff --git a/content/zh/projects/shenyu/_index.md b/content/zh/projects/shenyu/_index.md
index 0543555..deb5ec3 100644
--- a/content/zh/projects/shenyu/_index.md
+++ b/content/zh/projects/shenyu/_index.md
@@ -92,6 +92,8 @@ sidebar:
sub:
- title: 'Admin属性配置'
link: 'admin-property-config'
+ - title: '客户端属性配置'
+ link: 'client-property-config'
- title: '数据同步配置'
link: 'use-data-sync'
- title: '客户端接入配置'
@@ -192,6 +194,14 @@ sidebar:
link: 'thread'
- title: 'ShenYu调优'
link: 'shenyu-optimize'
+ - title: '自定义SPI'
+ sub:
+ - title: '自定义匹配方式'
+ link: 'custom-match-mode'
+ - title: '自定义条件参数'
+ link: 'custom-parameter-data'
+ - title: '自定义条件策略'
+ link: 'custom-predicate-judge'
- title: '版本发布'
link: 'release-notes'
- title: '文档下载'
diff --git a/content/zh/projects/shenyu/custom-condition-match/index.md b/content/zh/projects/shenyu/custom-condition-match/index.md
deleted file mode 100644
index 20a3707..0000000
--- a/content/zh/projects/shenyu/custom-condition-match/index.md
+++ /dev/null
@@ -1,74 +0,0 @@
----
-title: 自定义匹配条件策略
-keywords: Apache ShenYu
-description: 自定义匹配条件策略
----
-
-
-## 说明
-
-* 在自定义开发前,请先自定义搭建好网关环境,请参考: [自定义部署](../deployment-custom)
-
-* 本文介绍如何对 `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy` 进行自定义扩展。
-
-## 扩展实现
-
-* 新增一个类 `${you class}`,实现 `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`
-
-```
-public class ${you class} implements MatchStrategy {
-
- @Override
- public Boolean match(final List<ConditionData> conditionDataList, final ServerWebExchange exchange) {
- //开发你的匹配逻辑,返回结果
- return true;
- }
-}
-```
-
-* 在项目 `resources` 目录下,新建 `META-INF/shenyu` 目录, 并且新增文件名为 : `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`.
-内容新增 `${you spi name}` = `${you class path}`:
-
-```
-${you spi name} = ${you class path}
-```
-
-* 在 `Admin` 后台 ---> 基础管理 ---> 字典管理 , 找到字典编码为 `MATCH_MODE`,新增一条数据,注意字典名称要为: `${you spi name}`。
-
-<img src="/img/shenyu/custom/custom-condition-match-zh.png" width="40%" height="30%" />
-
-* 或者执行以下自定义`SQL`语句:
-
-```sql
-INSERT IGNORE INTO `shenyu_dict` (
- `id`,
- `type`,
- `dict_code`,
- `dict_name`,
- `dict_value`,
- `desc`,
- `sort`,
- `enabled`,
- `date_created`,
- `date_updated`
- )
-VALUES (
- 'you id',
- 'matchMode',
- 'MATCH_MODE',
- 'you spi name',
- 'you value',
- 'you spi name',
- 0,
- 1,
- '2021-05-30 19:29:10',
- '2021-05-30 20:15:23'
- );
-```
-
-
-
-
-
-
-
diff --git a/content/zh/projects/shenyu/custom-match-mode/index.md b/content/zh/projects/shenyu/custom-match-mode/index.md
new file mode 100644
index 0000000..b8a130c
--- /dev/null
+++ b/content/zh/projects/shenyu/custom-match-mode/index.md
@@ -0,0 +1,69 @@
+---
+title: 自定义匹配方式
+keywords: Apache ShenYu
+description: 自定义匹配方式
+---
+
+
+## 说明
+
+* 在自定义开发前,请先搭建好网关环境,请参考: [自定义搭建网关](../deployment-custom)
+
+* 本文介绍如何对 `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy` 进行自定义扩展。
+
+## 扩展实现
+
+* 新增一个类 `CustomMatchStrategy`,继承`org.apache.shenyu.plugin.base.condition.strategy.AbstractMatchStrategy`,实现 `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy` ,添加注解`org.apache.shenyu.spi.Join`。
+
+```java
+/**
+ * This is custom match strategy.
+ */
+@Join
+public class CustomMatchStrategy extends AbstractMatchStrategy implements MatchStrategy {
+
+ @Override
+ public Boolean match(final List<ConditionData> conditionDataList, final ServerWebExchange exchange) {
+ // 匹配逻辑实现
+ }
+}
+```
+
+* 在你的网关项目 `resources` 目录下,新建 `META-INF/shenyu` 目录, 并且新增文件名为 : `org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`.
+内容如下:
+
+```shell script
+${spi name} = ${custom class path}
+```
+
+`${spi name}`表示`spi`的名称,`${custom class path}`表示该类的全限定名。比如:
+
+```shell script
+custom = org.apache.shenyu.examples.http.strategy.CustomMatchStrategy
+```
+
+* 在`Apache ShenYu`网关管理系统 --> 基础配置 --> 字典管理, 找到字典编码为 `MATCH_MODE`,新增一条数据,注意字典名称要为: `${spi name}`,图中的示例是`custom`。
+
+<img src="/img/shenyu/custom/custom_match_strategy_zh.png" width="70%" height="60%" />
+
+ > 字典类型:`matchMode`;
+>
+ > 字典编码:`MATCH_MODE`;
+>
+ > 字典名称:`${spi name}`,填写自定义`spi`的名称;
+>
+ > 字典值:使用时,下拉框的值,不要和现有的重复;
+>
+ > 字典描述或备注信息:描述信息;
+>
+ > 排序: 排序;
+>
+ > 状态:打开或关闭。
+
+
+
+* 在添加选择器或规则时,就可以使用自定义的匹配方式:
+
+<img src="/img/shenyu/custom/use_custom_match_strategy_zh.png" width="80%" height="70%" />
+
+
diff --git a/static/img/shenyu/custom/custom-condition-match-en.png b/static/img/shenyu/custom/custom-condition-match-en.png
deleted file mode 100644
index 3de3d9e..0000000
Binary files a/static/img/shenyu/custom/custom-condition-match-en.png and /dev/null differ
diff --git a/static/img/shenyu/custom/custom-condition-match-zh.png b/static/img/shenyu/custom/custom-condition-match-zh.png
deleted file mode 100644
index b4c7d1e..0000000
Binary files a/static/img/shenyu/custom/custom-condition-match-zh.png and /dev/null differ
diff --git a/static/img/shenyu/custom/custom_match_strategy_en.png b/static/img/shenyu/custom/custom_match_strategy_en.png
new file mode 100644
index 0000000..cbfa0cc
Binary files /dev/null and b/static/img/shenyu/custom/custom_match_strategy_en.png differ
diff --git a/static/img/shenyu/custom/custom_match_strategy_zh.png b/static/img/shenyu/custom/custom_match_strategy_zh.png
new file mode 100644
index 0000000..5739258
Binary files /dev/null and b/static/img/shenyu/custom/custom_match_strategy_zh.png differ
diff --git a/static/img/shenyu/custom/use_custom_match_strategy_en.png b/static/img/shenyu/custom/use_custom_match_strategy_en.png
new file mode 100644
index 0000000..be5677e
Binary files /dev/null and b/static/img/shenyu/custom/use_custom_match_strategy_en.png differ
diff --git a/static/img/shenyu/custom/use_custom_match_strategy_zh.png b/static/img/shenyu/custom/use_custom_match_strategy_zh.png
new file mode 100644
index 0000000..fab1ccf
Binary files /dev/null and b/static/img/shenyu/custom/use_custom_match_strategy_zh.png differ