refactor(service): move server package to service and promote API to v1#17
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the HTTP layer from the
serverpackage into aservicepackage, bundling transport, data access, and business logic onto a singleServicestruct (the conventional name for a struct that owns the whole application unit). API routes are promoted fromv0tov1.This branch also cleans up collateral damage from the initial mechanical
server→servicefind-and-replace:observerMiddleware— had been mangled toobserviceMiddleware("observer" contained "server").*http.Serverstruct field renamedservice→server, avoiding the "Servicehas aservice" shadowing.@Routerannotations initem.goaligned to/v1(they still read/v0while the routes served/v1), and OpenAPI docs regenerated soswagger.jsonmatches.metrics servicecomment restored tometrics server.Changes
server/*→service/*, struct/constructor renamedServer/NewServer→Service/NewServiceerrorspackage holdingErrMethodNotAllowedand theJSONErrorresponse type/v1cmd/run.goandclient/repointed to the new packageTesting
go build ./...— passesgo vet ./...— cleango test ./service/... ./client/...— passes🤖 Generated with Claude Code