Repository navigation
v1.0.0
User Preferences Management Library Release Notes
Overview
Based on the provided Git diff, this release introduces several significant improvements and new features to the userprefs library, a Go library for managing user preferences with storage and caching capabilities.
New Features
Core Improvements
- Added structured logging using Go’s standard
slogfor enhanced observability - Improved error handling with new error types:
ErrValidation,ErrCacheClosed,ErrAlreadyExists,ErrSerialization,ErrInternal - Default value fallback mechanism for when cache/storage fails or preference isn’t set
- Updated to support Go 1.24
API Server
- New HTTP API server implementation in the
apipackage - REST endpoints for preference definitions management
- Chi router integration with middleware support
- Graceful shutdown handling
Storage Enhancements
- Enhanced PostgreSQL storage with configurable connection parameters
- SQLite storage improvements with WAL mode and busy timeout configuration
- Memory storage enhancements for testing and development
Cache Improvements
- Redesigned cache interface with binary storage (
[]byte) for better performance - Redis cache now supports configuration options via functional-options pattern
- Memory cache improvements with garbage collection for expired items
- Thread-safety enhancements for concurrent access
Documentation and Examples
- Added comprehensive examples for different storage and cache backends
- New example applications:
- Basic usage example
- Advanced example with PostgreSQL and Redis
- Discord bot integration example
- Docker Compose configuration for examples using PostgreSQL and Redis
- Expanded documentation in
README.md
Bug Fixes
- Fixed cache key serialization and data handling
- Improved error propagation from storage and cache layers
- Fixed memory leaks in the garbage collection routine for memory cache
- Enhanced transaction handling in database operations
Breaking Changes
- Cache interface now works with
[]byteinstead ofinterface{} - Logger interface updated to use structured-logging approach
- Go 1.24 is now the minimum required version
Internal Improvements
- Enhanced test coverage with mock implementations
- Code organization improvements with proper package documentation
- Linter configuration updates for code quality
- Build and release process refinements