Skip to content

Releases: sk-pkg/redis

v1.1.1 Release Notes

12 Aug 08:43

Choose a tag to compare

This release focuses on optimizing Redis operations, improving error handling, and fixing critical bugs. It includes significant enhancements to list operations and JSON-related functions.

🚀 Improvements and Optimizations

List Operations

  • Implemented batch operations for improved efficiency in LPush, RPush, LPushJSON, and RPushJSON functions
  • Refactored LPush, RPush, LPushJSON, and RPushJSON for better performance
  • Refactored context-aware versions: LPushWithContext, RPushWithContext, LPushJSONWithContext, and RPushJSONWithContext
    (0a28ed1)

JSON Operations

  • Added type checking for JSON operations to enhance reliability (0a28ed1)
  • Optimized GetJSON and GetJSONWithContext methods: Changed return result to error type for better error handling
    (4abf8f5, 2b3ab52)

Connection Management

  • Enhanced connection management with deferred closures (0a28ed1)
  • Implemented use of defer statement and anonymous functions to handle connection closure and log potential errors
    (9c57b80)

Error Handling

  • Improved error handling, especially for empty lists
  • Standardized error handling across all list functions
    (0a28ed1)

🐛 Bug Fixes

  • Fixed an issue where SetJSON failed to set when the expiration time was greater than 0
    (76e49c8)
  • Resolved a similar issue in SetJSONWithContext where it failed to set with non-zero expiration time
    (51279db)

📚 Documentation

  • Updated comments and examples for clarity (0a28ed1)
  • Corrected existing comments for improved accuracy (a29c2d5)

🔨 Other Changes

  • Various code refactoring and optimizations for overall performance improvement (0a28ed1)

v1.1.0 Release Notes

23 Jul 08:47

Choose a tag to compare

  1. Improved documentation: Added detailed comments for all functions, structs, and constants, making the package more developer-friendly.

  2. Better error handling: Many functions now return more appropriate error types, improving error detection and handling.

  3. 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
  4. 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
  5. 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
  6. 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.)
  7. 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.

v1.0.1

14 Jun 08:17

Choose a tag to compare

Rename organization

v1.0.0

14 Jun 02:39

Choose a tag to compare

Redis是在redigo基础上封装的快速使用包。