mirror of
https://gitcode.com/JianFeeeee/homeagent-sdk.git
synced 2026-09-20 08:58:03 +00:00
- README.md/README_EN.md:新增删除清理(onRemove)小节——语义(仅卸载 触发、重载/禁用不触发,Stop 之后执行)、内核配套清理(工具注册/disabled/ 配置项定义 plugin.<name>.*/配置表 config_<name>)、示例清单与代码片段 - plugindev 模板 README.md.tmpl:新增 Lifecycle 段(RegisterStopHandler 每次 停止、RegisterOnRemoveHandler 仅卸载)
# {{.Plg.Name}}
{{.Plg.Description}}
## Build
```bash
plugindev build
```
## Install
Upload the `.hmap` file through the Plugin Manager API:
```bash
curl -X POST http://localhost:8080/api/v1/plugins \
-H "Content-Type: application/octet-stream" \
--data-binary @dist/<name_en_snake>_linux_amd64.hmap
```
## Lifecycle
- `RegisterStopHandler` — runs on every stop (including reload/disable), before `Stop()`.
- `RegisterOnRemoveHandler` — runs **only on uninstall (remove)**, after `Stop()`; clean up the plugin's own data files here. Reload/disable do NOT trigger it. See the onRemove demo in `main.go`.