Stream beets imports over HTTP.

refactor(server,cli): group config options and centralize env loading #25

Merged glerp.sullen.net
targeting main from glerp.sullen.net/goosefoot:refactor/organize-config
Merged opened by and assigned to glerp.sullen.net
targeting main from glerp.sullen.net/goosefoot:refactor/organize-config

Summary #

Organizes configuration fields, environment variable loading, and documentation in a consistent top-to-bottom order with zero behavioral changes:

  • Logical grouping (internal/server/server.go, cmd/goosefoot/main.go, env.example, README.md): Order configuration uniformly by concern—required settings (GOOSEFOOT_API_KEY, GOOSEFOOT_IMPORT_DIR), HTTP server (GOOSEFOOT_HOST, GOOSEFOOT_PORT), import pipeline (GOOSEFOOT_HOOKS_DIR, BEETS_BIN), logging (LOG_LEVEL, FORCE_COLOR), and internal server tuning (timeouts/TTLs, then admission limits).
  • Centralized boundary loading (cmd/goosefoot/main.go): Extract loadConfig so all getenv reads happen in one place at the CLI entry boundary, and extract normalizeConfig in internal/server/server.go mirroring server.Config's field order.
  • Documentation parity (README.md): Document FORCE_COLOR alongside LOG_LEVEL to match env.example.

Verification #

  • gofmt -l .
  • go vet ./...
  • go test -race -count=1 ./...
Commits 0