How larksuite/oapi-sdk-go works
This is the Feishu OpenPlatform Go server SDK: developers use a configured client to call typed APIs, manage credentials, and handle events; optional modules add WebSocket chat and one-click app registration. The graph preserves broad API domains and the README’s additional product capabilities. Sampled source confirms client request delegation, token caching, and WebSocket receive behavior; unsampled feature wiring is limited to documented relationships.
Main entry points: apireq.go HTTP request core · channel.go Channel listener · client.go SDK client · service Typed API domains
Components 18
Client and auth
- SDK client
client.go - HTTP request core
core/apireq.go - Token manager
core/tokenmanager.go - Token cache
core/cache.go - App ticket manager
core/appticketmanager.go
Platform APIs
- Typed API domains
service
Events and callbacks
- Event dispatcher
event/dispatcher - Card callbacks
event/dispatcher/callback
Channel messaging
- WebSocket client
ws/client.go - Channel listener
channel/channel.go - Message normalization
channel/normalize/parser.go - Chat batching
channel/pipeline/chat_pipeline.go - Outbound messaging
channel/send.go
Optional workflows
- App registration
scene/registration/registration.go
Other components
- SDK developer
- Feishu platform
- Open platform APIs
- WebSocket service
Connections 24
- SDK developer → SDK client: configures
- SDK developer → Typed API domains: calls APIs
- SDK client → Typed API domains: initializes
- SDK client → HTTP request core: delegates requests
- HTTP request core → Token manager: gets access token
- Token manager → Token cache: reads and writes
- HTTP request core → Open platform APIs: sends HTTP requests
- Typed API domains → HTTP request core: issues API requests
- Open platform APIs → HTTP request core: returns responses
- Feishu platform → Event dispatcher: delivers events
- SDK developer → Event dispatcher: registers handlers
- SDK developer → Card callbacks: handles callbacks
- Feishu platform → Card callbacks: delivers callbacks
- SDK developer → Channel listener: starts listener
- Channel listener → WebSocket client: uses transport
- WebSocket client → WebSocket service: connects and receives
- Channel listener → Message normalization: normalizes messages
- Channel listener → Chat batching: batches messages
- SDK developer → Outbound messaging: sends replies
- Outbound messaging → SDK client: uses API client
- SDK developer → App registration: starts registration
- App registration → Feishu platform: requests authorization
- SDK developer → App ticket manager: uses ticket flow
- Event dispatcher → App ticket manager: stores app tickets