feat: add configuration management with YAML parsing and validation

Add internal/config package with Config struct (Server, Navidrome,
MusicBrainz, Telegram, Scanner sections), LoadConfig function for
YAML parsing, config validation (required fields, port range,
threshold range), and defaults. Include config.yaml.example matching
spec. Update main.go to use real config package instead of
placeholders. Add comprehensive tests covering valid configs,
defaults, missing files, malformed YAML, and validation boundaries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MrixsandClaude Opus 4.6 committed 2026-05-20 08:47:04 +03:00
1 parent eb266ed5ec
commit 6ff4ec3045
8 files changed
+563 -71

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
server:
host: "0.0.0.0"
port: 8080
# Basic Auth for Web UI access
username: "admin"
password: "password123"
navidrome:
url: "http://localhost:4533"
user: "watcher_service"
password: "user_password"
musicbrainz:
user_agent: "NaviWatcher/1.0 ( your-email@example.com )"
cache_ttl: 24h
telegram:
enabled: true
token: "bot_token"
chat_id: "your_chat_id"
cron_schedule: "0 10 * * *"
scanner:
fuzzy_threshold: 0.85
ignore_bootlegs: true
include_compilations: true