Skip to content

Releases: cdyue/lian

v0.0.8

08 May 04:17

Choose a tag to compare

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 Debug method on slogLogger now delegates to slog.Info internally, 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

29 Apr 15:30

Choose a tag to compare

  • ❌ Removed all HeaderMapping related functionality, including:
    • Global SetDefaultHeaderMapping, SetDefaultAuthHeaderName, SetDefaultTenantIDHeaderName, SetDefaultUserIDHeaderName, SetDefaultTargetTenantHeaderName, SetDefaultEntryPathHeaderName methods
    • Global SetDefaultAuthExtractor, SetDefaultTenantIDExtractor, SetDefaultUserIDExtractor, SetDefaultTargetTenantExtractor, SetDefaultEntryPathExtractor methods
    • Request-level SetHeaderMapping, SetAuthHeaderName, SetTenantIDHeaderName, SetUserIDHeaderName, SetTargetTenantHeaderName, SetEntryPathHeaderName methods
    • Request-level SetAuthExtractor, SetTenantIDExtractor, SetUserIDExtractor, SetTargetTenantExtractor, SetEntryPathExtractor methods
    • FromContext() method that provided automatic header extraction and injection from context
    • SetTenant, SetUserID, SetOperator, SetTenantUser convenience header setter methods
    • WithTenant, WithUserID, WithOperator functional option helpers

Improvements

  • ✨ Refactored mergeClientTraces implementation to eliminate duplicate code, while maintaining full backward compatibility for all HTTP tracing functionality
  • ✨ Replaced all remaining interface{} usages with modern Go 1.18+ any type alias for cleaner code
  • ✨ Fixed all code formatting issues to fully comply with standard Go gofmt formatting rules
  • ✨ All code now passes full go vet static analysis checks with zero warnings

Compatibility

  • Requires Go 1.18 or newer (due to any type 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

10 Apr 04:08

Choose a tag to compare

New Features

  1. 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
  2. API Usability Improvements

    • Renamed SetOperator() to more semantically accurate SetUserID() (old method retained for backward compatibility with deprecation notice)
    • Added corresponding WithUserID() and WithTenant() functional options
    • Fixed SetTenant() and SetUserID() to respect custom header names configured in HeaderMapping (previously hardcoded to use "X-Tenant-Id" and "X-User-Id")

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

09 Apr 12:08

Choose a tag to compare

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

27 Mar 09:20

Choose a tag to compare

v0.0.4 - 2026-03-27

Breaking Changes

  • Default State: Both OpenTelemetry tracing and HTTP console trace are now disabled by default
  • Default State: Users need to explicitly enable tracing via global switches or per-request methods

v0.0.3

27 Mar 09:11

Choose a tag to compare

v0.0.3 - 2026-03-27

Improvements

  • Documentation: Updated README with latest API changes and usage examples
  • Documentation: Added CHANGELOG.md for release tracking
  • Release: Prepared for v0.0.3 official release

v0.0.2

27 Mar 05:15

Choose a tag to compare

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 otel tag 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