Core features and design principles of go-workwx
v2The go-workwx SDK is designed for production-grade Work Weixin integration with a focus on type safety and minimal public surface area. Key features include:
- Customizable Networking: Supports overriding the API
Host(useful for gateways or debugging) and using a customhttp.Client. - Robust Access Token Management:
- Automatic token retrieval during API calls.
- Option to start a background goroutine for continuous token refreshing.
- Built-in exponential backoff retries.
- Type Safety: The SDK uses idiomatic Go types (e.g.,
UserInfo,Recipient) rather than exposing raw API request/response structures. It prioritizes static dispatch and avoids unnecessary polymorphism. - Stability: The library avoids
panicin standard business logic; panics are reserved for unit tests or internal test commands.