feat: 补齐模块接口契约与管理 API 文档

This commit is contained in:
Nixevol
2026-09-30 06:36:28 +08:00
parent dd5a331db2
commit 22c56d1f35
23 changed files with 1782 additions and 3 deletions
+23
View File
@@ -0,0 +1,23 @@
package port
import (
"context"
"testing"
)
func TestStubDownlinkPublish(t *testing.T) {
d := &StubDownlink{}
if err := d.PublishDown(context.Background(), "a", "c1", []byte(`{}`), PublishOpts{QoS: 1}); err != nil {
t.Fatal(err)
}
if d.Published != 1 {
t.Fatalf("published=%d", d.Published)
}
}
func TestStubUplinkHandlerCompile(t *testing.T) {
var h UplinkHandler = StubUplinkHandler{}
if err := h.OnSessionEstablished(context.Background(), ConnInfo{EndpointID: "a"}); err != nil {
t.Fatal(err)
}
}