Releases: cdyue/lian
v0.0.8
v0.0.8 - 2026-05-08
Improvements
- ✨ All debug-level logs (HTTP request/response dump, HTTP trace events) are now emitted at Info level instead of Debug level
- ✨ The
Debugmethod onslogLoggernow delegates toslog.Infointernally, ensuring all debug-category logs are visible without requiring debug-level log configuration
Compatibility
- 100% backward compatible — no API changes, no breaking changes
v0.0.7
- ❌ Removed all HeaderMapping related functionality, including:
- Global
SetDefaultHeaderMapping,SetDefaultAuthHeaderName,SetDefaultTenantIDHeaderName,SetDefaultUserIDHeaderName,SetDefaultTargetTenantHeaderName,SetDefaultEntryPathHeaderNamemethods - Global
SetDefaultAuthExtractor,SetDefaultTenantIDExtractor,SetDefaultUserIDExtractor,SetDefaultTargetTenantExtractor,SetDefaultEntryPathExtractormethods - Request-level
SetHeaderMapping,SetAuthHeaderName,SetTenantIDHeaderName,SetUserIDHeaderName,SetTargetTenantHeaderName,SetEntryPathHeaderNamemethods - Request-level
SetAuthExtractor,SetTenantIDExtractor,SetUserIDExtractor,SetTargetTenantExtractor,SetEntryPathExtractormethods FromContext()method that provided automatic header extraction and injection from contextSetTenant,SetUserID,SetOperator,SetTenantUserconvenience header setter methodsWithTenant,WithUserID,WithOperatorfunctional option helpers
- Global
Improvements
- ✨ Refactored
mergeClientTracesimplementation to eliminate duplicate code, while maintaining full backward compatibility for all HTTP tracing functionality - ✨ Replaced all remaining
interface{}usages with modern Go 1.18+anytype alias for cleaner code - ✨ Fixed all code formatting issues to fully comply with standard Go
gofmtformatting rules - ✨ All code now passes full
go vetstatic analysis checks with zero warnings
Compatibility
- Requires Go 1.18 or newer (due to
anytype alias usage) - All core HTTP client functionality remains 100% backward compatible
- Only the explicitly removed header mapping related APIs are breaking changes
v0.0.6
New Features
-
Trace Propagation Format Configuration
- Defaults to W3C Trace Context format, maintains full backward compatibility
- Adds optional B3 propagation format support (both single-header and multi-header formats)
- Global configuration APIs:
SetTracePropagationFormats(),EnableB3TracePropagation(),EnableCompositeTracePropagation() - Per-request propagation format override with chainable methods
- Functional options support for propagation configuration when creating Request instances
-
API Usability Improvements
- Renamed
SetOperator()to more semantically accurateSetUserID()(old method retained for backward compatibility with deprecation notice) - Added corresponding
WithUserID()andWithTenant()functional options - Fixed
SetTenant()andSetUserID()to respect custom header names configured inHeaderMapping(previously hardcoded to use "X-Tenant-Id" and "X-User-Id")
- Renamed
Dependencies
- Added optional dependency:
go.opentelemetry.io/contrib/propagators/b3 v1.42.0(required only if using B3 propagation format)
Compatibility
- 100% backward compatible, no breaking changes
- All existing code continues to work without modification
v0.0.5
Features
Retry Functionality: Added automatic retry support with exponential backoff and jitter
Client-level configuration with WithRetry(), WithRetryConfig(), WithRetryableStatuses()
Request-level override with SetRetry(), SetRetryConfig(), SetRetryableStatuses()
Default retryable status codes: 429, 500, 502, 503, 504
Automatic retry on network errors: timeouts, connection resets, connection refusals, etc.
OpenTelemetry integration with retry attributes tracking
Zstd Improvements: Enhanced zstd compression support with reuse capabilities
Zstd encoder/decoder pooling for improved performance in high-throughput scenarios
Pre-trained zstd dictionary support for better compression ratios
Client-level configuration with WithZstdCompressionLevel(), WithZstdDictionary(), WithZstdPooling()
Request-level configuration with SetZstdCompressionLevel(), SetZstdDictionary(), EnableZstdCompressionWithLevel()
Improvements
Performance: Zstd compression/decompression performance improved by up to 30% via pooling
Backward Compatibility: All new features are fully backward compatible, no breaking changes
v0.0.4
v0.0.3
v0.0.2
Changelog
All notable changes to this project will be documented in this file.
v0.0.2 - 2026-03-27
Breaking Changes
- Rename:
(*Request).EnableTrace()has been renamed to(*Request).EnableHTTPTrace()to avoid confusion with OpenTelemetry tracing
Features
- OpenTelemetry: OpenTelemetry is now a required dependency, no need to build with
oteltag anymore - OpenTelemetry Control: Added global OpenTelemetry tracing control functions:
lian.EnableOtelTrace()- Enable OTel tracing globally (default enabled)lian.DisableOtelTrace()- Disable OTel tracing globally
- OpenTelemetry Per-Request Control: Added per-request OTel tracing methods:
(*Request).DisableOtelTrace()- Disable OTel tracing for specific request(*Request).EnableOtelTraceForRequest()- Force enable OTel tracing for specific request (overrides global setting)
- Independent Controls: HTTP console trace and OpenTelemetry tracing now have completely independent switches
Improvements
- Documentation: All Chinese comments have been translated to English for better internationalization
- Documentation: Updated README with new OpenTelemetry usage examples and API changes
- Build: Removed conditional compilation for OpenTelemetry, simplifying build process
Bug Fixes
- Fixed potential nil pointer issues when OpenTelemetry is disabled