From 6c33bfdb82a32c97b7b981333d0875d817123068 Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Sat, 26 Sep 2026 13:18:55 +0800 Subject: [PATCH] =?UTF-8?q?docs(sdk):=20=E4=BF=AE=E6=AD=A3=20ProxyReg=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=B3=A8=E9=87=8A=E9=87=8C=E7=9A=84=E6=97=A7?= =?UTF-8?q?=E5=90=8D=EF=BC=88DeclareProxy=E2=86=92RegisterProxy=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename 时漏改了字段注释。代码本身一致(proxyReg 字段 + RegisterProxy 方法), 但注释里写着一个不存在的 API 名,读者按注释找不到方法。 --- internal/sdk/plugin.go | 2 +- third_party/homeagent-sdk/sdk/plugin.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/sdk/plugin.go b/internal/sdk/plugin.go index 0acfd7a..e7c9f06 100644 --- a/internal/sdk/plugin.go +++ b/internal/sdk/plugin.go @@ -320,7 +320,7 @@ type SDKConfig struct { func New(name string, cfg SDKConfig) *PluginSDK { base := pubsdk.New(name, cfg.Settings, cfg.RegTool, cfg.RegStage, cfg.RegAPI, cfg.RegOutput) - // 反代声明收集:内置插件(无 plugin.json)在 Start 里用 DeclareProxy + // 反代声明收集:内置插件(无 plugin.json)在 Start 里用 RegisterProxy // 声明自己的服务,落到本包的登记表;外部插件走 plugin.json 自动发现。 base.SetProxyRegistrar(func(svc string, d pubsdk.ProxyDef) { RegisterBuiltinProxy(name, svc, d) }) if cfg.IOManager != nil { diff --git a/third_party/homeagent-sdk/sdk/plugin.go b/third_party/homeagent-sdk/sdk/plugin.go index ae17ab1..6852696 100644 --- a/third_party/homeagent-sdk/sdk/plugin.go +++ b/third_party/homeagent-sdk/sdk/plugin.go @@ -353,7 +353,7 @@ type PluginSDK struct { events EventSubscriber plgMgr PluginMgrAPI - // proxyDecl 是反代声明的收集回调(内置插件经 DeclareProxy 声明服务)。 + // proxyReg 是反代声明的注册回调(内置插件经 RegisterProxy 声明服务)。 // 与上面的 API 字段同受 apiMu 保护——写方是内核注入,读方是插件 Start // 起的 goroutine。 proxyReg ProxyRegistrar