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

feat: sse-timing plugin for tracing events #1361

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
13 changes: 7 additions & 6 deletions plugins/wasm-rust/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ IMAGE_TAG = $(if $(strip $(PLUGIN_VERSION)),${PLUGIN_VERSION},${BUILD_TIME}-${CO
IMG ?= ${REGISTRY}${PLUGIN_NAME}:${IMAGE_TAG}

.DEFAULT:
lint-base:
cargo fmt --all --check
cargo clippy --workspace --all-features --all-targets
lint:
cargo fmt --all --check --manifest-path extensions/${PLUGIN_NAME}/Cargo.toml
cargo clippy --workspace --all-features --all-targets --manifest-path extensions/${PLUGIN_NAME}/Cargo.toml
build:
DOCKER_BUILDKIT=1 docker build \
--build-arg PLUGIN_NAME=${PLUGIN_NAME} \
Expand All @@ -20,3 +14,10 @@ build:
.
@echo ""
@echo "output wasm file: extensions/${PLUGIN_NAME}/plugin.wasm"

lint-base:
cargo fmt --all --check
cargo clippy --workspace --all-features --all-targets
lint:
cargo fmt --all --check --manifest-path extensions/${PLUGIN_NAME}/Cargo.toml
cargo clippy --workspace --all-features --all-targets --manifest-path extensions/${PLUGIN_NAME}/Cargo.toml
26 changes: 26 additions & 0 deletions plugins/wasm-rust/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## 介绍

此 SDK 用于使用 Rust 语言开发 Higress 的 Wasm 插件。

### 创建新插件

在当前文件夹下(`plugins/wasm-rust`)执行下面的命令,将`${...}`替换为新插件的内容,其中`--name`为必填项。

```shell
sh ./scripts/gen.sh \
--name ${NAME} \
--keywords ${KEYWORDS} \
--description ${DESCRIPTION} \
```

执行完成后将会在`plugins/wasm-rust/extensions/${NAME}`目录下生成以下文件,其中`src/lib.rs`中的内容即为插件需要实现的逻辑

```tree
.
├── Cargo.toml
├── Makefile
├── README.md
├── README_EN.md
├── VERSION
└── src
└── lib.rs
```

执行`make docker-compose`可以在docker中运行higress实例,并通过`curl localhost:${PORT}`来测试插件是否正常运行
27 changes: 0 additions & 27 deletions plugins/wasm-rust/extensions/say-hello/docker-compose.yaml

This file was deleted.

86 changes: 0 additions & 86 deletions plugins/wasm-rust/extensions/say-hello/envoy.yaml

This file was deleted.

Loading
Loading