Skip to content

refactor(service): move server package to service and promote API to v1#17

Merged
ATMackay merged 3 commits into
mainfrom
feat/service-errors
Jul 3, 2026
Merged

refactor(service): move server package to service and promote API to v1#17
ATMackay merged 3 commits into
mainfrom
feat/service-errors

Conversation

@ATMackay

@ATMackay ATMackay commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

Refactors the HTTP layer from the server package into a service package, bundling transport, data access, and business logic onto a single Service struct (the conventional name for a struct that owns the whole application unit). API routes are promoted from v0 to v1.

This branch also cleans up collateral damage from the initial mechanical serverservice find-and-replace:

  • observerMiddleware — had been mangled to observiceMiddleware ("observer" contained "server").
  • *http.Server struct field renamed serviceserver, avoiding the "Service has a service" shadowing.
  • @Router annotations in item.go aligned to /v1 (they still read /v0 while the routes served /v1), and OpenAPI docs regenerated so swagger.json matches.
  • Stray metrics service comment restored to metrics server.

Changes

  • server/*service/*, struct/constructor renamed Server/NewServerService/NewService
  • New errors package holding ErrMethodNotAllowed and the JSONError response type
  • Endpoints moved to /v1
  • cmd/run.go and client/ repointed to the new package
  • OpenAPI docs regenerated

Testing

  • go build ./... — passes
  • go vet ./... — clean
  • go test ./service/... ./client/... — passes

🤖 Generated with Claude Code

ATMackay and others added 3 commits July 3, 2026 12:38
Repairs collateral damage from the mechanical server->service rename:
- restore observerMiddleware (was mangled to observiceMiddleware)
- rename the *http.Server struct field service->server to avoid the
  'Service has a service' shadowing
- fix 'metrics server' comment
- align item.go @router annotations to /v1 and regenerate OpenAPI docs

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ATMackay ATMackay added patch patch update minor and removed patch patch update labels Jul 3, 2026
@ATMackay ATMackay merged commit c940e9b into main Jul 3, 2026
3 checks passed
@ATMackay ATMackay deleted the feat/service-errors branch July 3, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant