v1.1.0 Release Notes
-
Improved documentation: Added detailed comments for all functions, structs, and constants, making the package more developer-friendly.
-
Better error handling: Many functions now return more appropriate error types, improving error detection and handling.
-
New features:
- Added Ping() method to check Redis connection health
- Implemented prefixKey() method for consistent key prefixing
- New() function now performs an initial ping to verify the connection
- Introduced context-aware versions of all existing Redis operations for improved control over timeouts and cancellations
- Added new SetNXWithContext method for atomic set-if-not-exists operation with context support
-
Performance improvements:
- Refactored BatchDel() to use SCAN instead of KEYS, making it more efficient for large datasets and less likely to block the Redis server
-
Code quality:
- Removed unsafe package import
- Added copyright notice and improved package description
- Consistent use of 'any' type instead of 'interface{}' for better Go 1.18+ compatibility
-
API changes:
- New() function now returns an error in addition to the Manager instance
- Some functions have slightly modified return types for better error handling
- Added context-aware versions of all existing methods (e.g., GetWithContext, SetWithContext, etc.)
-
Documentation:
- Updated README with comprehensive list and examples of new context-aware methods
This release focuses on improving the overall quality, performance, and usability of the redis package. It introduces context-aware methods for better handling of timeouts and cancellations in Redis operations, improving application responsiveness and resource management. Users upgrading to this version may need to update their code to handle the new error return from the New() function and can take advantage of the new context-aware methods for improved control over Redis operations.