Skip to content

v1.0.0

Choose a tag to compare

@buckedunicorn buckedunicorn released this 19 May 22:28
· 4 commits to main since this release
v1.0.0
678c7f9

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 slog for 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 api package
  • 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 []byte instead of interface{}
  • 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