审计结论:plugins/web-rust-archive/ 不是 Cargo workspace 成员、默认不构建、 无任何脚本/代码引用,官方 web 插件早已是 Go 版(plugins/web/ + libweb.so)。 仅作为"参考"留在树里,占 Rust 代码量约 18%。 删除内容: - plugins/web-rust-archive/(31 个文件,14,235 行 Rust,528K) - 更新三处指向:Cargo.toml 注释、plugins/web/README.md、ext-web-go-rewrite.md, 说明历史保留在 git 中 - CHANGELOG Unreleased 记录此次精简 验证:cargo build --release 通过;cargo test --release 565 passed / 0 failed。 这是「不要让冗余代码毁坏 marqdo 设计」的第一步;后续按审计报告继续: HostFn 元数据表合一(~400L)、plugin ABI 共用 SDK(~550L)、 catalog 复用 knowledge 助手(~140L)、view 路由表化(~130L)、 as_text 19→1(~90L)、view/html 字符串拆分与去重(~300L)。
30 lines
1.0 KiB
Markdown
30 lines
1.0 KiB
Markdown
# Marqdo `plugins/web` — Go (C ABI v2)
|
||
|
||
施工图:[doc/design/ext-web-go-rewrite.md](../../doc/design/ext-web-go-rewrite.md) · ADR:[0004](../../doc/adr/0004-web-plugin-go.md)
|
||
|
||
**Default native web plugin (W-G13).** `plugin.native_path name=web` resolves `plugins/web/build/libweb.so` (and copies under `target/{debug,release}/`).
|
||
|
||
## Build
|
||
|
||
```bash
|
||
./scripts/build-web-plugin.sh
|
||
# → plugins/web/build/libweb.so
|
||
# → also copied to target/debug|release/libweb.so
|
||
```
|
||
|
||
Requires **Go 1.22+** with cgo (`CGO_ENABLED=1`) and a C toolchain.
|
||
|
||
Override path: `export MARQDO_WEB_PLUGIN=$PWD/plugins/web/build/libweb.so`
|
||
|
||
## Layout
|
||
|
||
| Path | Role |
|
||
|------|------|
|
||
| `plugin.go` / `abi_*.go` | `//export` ABI entry + registration |
|
||
| `abi/marqdo_abi_cgo.h` | C contract for cgo |
|
||
| `internal/*` | page / db / http / ws / … |
|
||
|
||
The legacy Rust implementation was archived during v1.6 and then removed from the
|
||
working tree (it remains in git history before commit `<this commit>`); see
|
||
`CHANGELOG.md` “默认 libweb 为 Go”。
|