Files
ncb-tts-r2/Cargo.toml
mii443 733646b6b8 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
2025-05-28 01:01:12 +09:00

83 lines
1.7 KiB
TOML

[package]
name = "ncb-tts-r2"
version = "1.11.2"
edition = "2021"
[lib]
name = "ncb_tts_r2"
path = "src/lib.rs"
[[bin]]
name = "ncb-tts-r2"
path = "src/main.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde_json = "1.0"
serde = "1.0"
toml = "0.8.19"
gcp_auth = "0.5.0"
reqwest = { version = "0.12.9", features = ["json"] }
base64 = "0.22.1"
async-trait = "0.1.57"
redis = { version = "0.29.2", features = ["aio", "tokio-comp"] }
bb8 = "0.8"
bb8-redis = "0.16"
thiserror = "1.0"
regex = "1"
tracing-subscriber = "0.3.19"
lru = "0.13.0"
once_cell = "1.19"
bincode = "1.3"
tracing = "0.1.41"
opentelemetry_sdk = { version = "0.29.0", features = ["trace"] }
opentelemetry = "0.29.1"
opentelemetry-semantic-conventions = "0.29.0"
opentelemetry-otlp = { version = "0.29.0", features = ["grpc-tonic"] }
opentelemetry-stdout = "0.29.0"
tracing-opentelemetry = "0.30.0"
symphonia-core = "0.5.4"
tokio-util = { version = "0.7.14", features = ["compat"] }
futures = "0.3.31"
bytes = "1.10.1"
voicevox-client = { git = "https://github.com/mii443/rust" }
[dependencies.uuid]
version = "1.11.0"
features = ["serde", "v4"]
[dependencies.songbird]
version = "0.5"
features = ["builtin-queue"]
[dependencies.symphonia]
version = "0.5"
features = ["mp3"]
[dependencies.serenity]
version = "0.12"
features = [
"builder",
"cache",
"client",
"gateway",
"model",
"utils",
"unstable_discord_api",
"collector",
"rustls_backend",
"framework",
"voice",
]
[dependencies.tokio]
version = "1.0"
features = ["macros", "rt-multi-thread"]
[dev-dependencies]
tokio-test = "0.4"
mockall = "0.12"
tempfile = "3.8"
serial_test = "3.0"