Core CRUD resource flows#3
Conversation
| }) | ||
| } | ||
|
|
||
| func (h Handler) createImage(w http.ResponseWriter, r *http.Request) { |
There was a problem hiding this comment.
This is the representative handler shape for the first CRUD slice: decode the OpenStack wire request, convert to an app input, call the app service, then map back to a response DTO. Similar handlers in network, volume, and compute can be reviewed against this pattern.
| } | ||
|
|
||
| func (h Handler) getImage(w http.ResponseWriter, r *http.Request) { | ||
| image, err := h.service.Get(chi.URLParam(r, "image_id")) |
There was a problem hiding this comment.
API handlers translate app-layer not-found errors into OpenStack-style HTTP responses here. This keeps storage/domain error details out of the wire DTO layer.
| return servers | ||
| } | ||
|
|
||
| func (s *Service) CreateServer(input CreateServer) Server { |
There was a problem hiding this comment.
This early slice still keeps state directly in the service. That is intentional for the first working API surface, but it is also the pressure point that the later repository-boundary PR extracts.
| return Flavor{}, ErrFlavorNotFound | ||
| } | ||
|
|
||
| func (s *Service) ListServers() []Server { |
There was a problem hiding this comment.
The ids slice preserves deterministic list order separately from the map lookup path. The same ordering concern shows up again in repository implementations.
9964df1 to
791c424
Compare
Summary
Main Review Points
Verification