refactor: Major overhaul with error handling, resilience patterns, and observability

- Add library configuration to support both lib and binary targets
- Implement unified error handling with NCBError throughout the codebase
- Add circuit breaker pattern for external API calls (Voicevox, GCP TTS)
- Introduce comprehensive performance metrics and monitoring
- Add cache persistence with disk storage support
- Implement retry mechanism with exponential backoff
- Add configuration file support (config.toml) with env var fallback
- Enhance logging with structured tracing (debug, warn, error levels)
- Add extensive unit tests for cache, metrics, and circuit breaker
- Update base64 decoding to use modern API
- Improve API error handling for Voicevox and GCP TTS clients

Breaking changes:
- Function signatures now return Result<T, NCBError> instead of panicking
- Cache key structure modified with serialization support
This commit is contained in:
mii443
2025-05-28 01:01:12 +09:00
parent 0bea81aa6e
commit 733646b6b8
19 changed files with 2508 additions and 382 deletions

BIN
tts_cache.bin Normal file

Binary file not shown.