使用手冊

Go SDK

使用 draft pure Go SDK 整合 device client、automation、telemetry、firmware 與 signaling。

Status 與安裝

Go SDK 是 draft/internal package,不在第一波五 package user delivery bundle。以 Go 1.21+ import github.com/hkt999rtk/rtk_cloud_client/packages/golang/rtkc,並 pin approved commit/release。

Client、auth 與能力

rtkc.NewClient/ClientConfig 建立 client。所有 network call 接受 context.Context;傳遞 deadline/cancellation 並確定性地 close session/client。使用 token refresh helper 或 auth package 的 PKI CSR/mTLS helper,保護 PEM/PKCS#11 key。以 rtkc.WithCorrelation 加入 sanitized correlation ID。

Module 包含 device lifecycle、owner WebSocket transport、MQTT hook、WebRTC signaling、telemetry 與 firmware vocabulary。Application 仍負責 media engine、persistent state、rollout policy 與 product authorization。

驗證

執行 CGO_ENABLED=0 go build ./...CGO_ENABLED=0 go test ./...。Release manifest 未改變 status 前,不宣稱 public distribution。

其他手冊章節

繼續閱讀相關手冊章節。

SDK 總覽

選擇 package 並理解支援邊界。

開啟章節

開始使用

安裝 SDK、設定 client 並完成第一次 request。

開啟章節

認證與安全

安全處理 token、PKI、TLS、key 與 media。

開啟章節

生命週期與錯誤

處理 timeout、retry、cancel、callback 與 shutdown。

開啟章節

能力工作流

整合 provisioning、device、telemetry、OTA、command 與 signaling。

開啟章節

Video Cloud 工作流

整合 Live WebRTC signaling 與 encrypted stored video。

開啟章節

Native C/C++ SDK

使用 stable C ABI、C++ wrapper、transport 與 streaming upload。

開啟章節

Android Kotlin SDK

使用 coroutine、signaling、Media3 與 secure key provider。

開啟章節

iOS Swift SDK

使用 async API、signaling、AVPlayer、Keychain 與 Secure Enclave。

開啟章節

JavaScript/TypeScript SDK

在 browser 與 Node.js 整合 typed ESM package。

開啟章節

FreeRTOS/Pro2 SDK

整合 board、transport、media 與 WebRTC answerer adapter。

開啟章節

Sample applications

正確使用 Android、iOS、Web、Linux 與 Pro2 sample。

開啟章節

除錯與相容性

診斷認證、transport、upload、playback 與版本問題。

開啟章節