Tags: boj/redistore
Tags
feat: unify store initialization with flexible option-based API (#92) * feat: unify store initialization with flexible option-based API - Replace legacy initialization functions with a unified NewStore() using the Option Pattern - Add extensive configuration options for connection, authentication, Redis, and session settings - Implement strict validation for configuration and connection options at initialization - Remove code duplication and improve separation of concerns in store setup - Update documentation and usage examples for the new API - Add a comprehensive migration guide for upgrading from v1 to v2 - Update module path to github.com/boj/redistore/v2 for semantic versioning - Improve error messages and fail-fast behavior for invalid configurations - Add a new test suite with thorough coverage for option validation and error handling - Deprecate v1 API and document migration steps - Enhance developer experience with clearer, more flexible, and self-documenting options Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * refactor: refactor error handling and option selection logic - Refactor error construction to use multiline return statements for clarity - Replace if-else chains with a switch statement for connection option selection - Update tests to build expected error strings in multiple lines for consistency with implementation Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * feat: refactor key management to support key rotation and helpers - Change NewStore to accept key pairs as [][]byte instead of []byte, enabling proper support for key rotation - Add Keys and KeysFromStrings helper functions for easier key pair creation - Update documentation and migration guides to reflect the new key pairs format and usage - Add detailed examples and explanations for key rotation and helper usage - Update all code and tests to use the new key pairs format and helpers - Add tests for key rotation and the new helper functions Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * Update redistore.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor: refactor Redis error handling to use shared constants - Refactor repeated Redis connection error strings into constants for improved maintainability - Update tests to use the new error constants instead of hardcoded error messages Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>