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:
26
config.yaml.example
Normal file
26
config.yaml.example
Normal 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
|
||||
Reference in New Issue
Block a user