519aa35f1f
routing table
884 B
884 B
ADR-0005: Keep Service Contracts Protocol-Neutral
Status: Accepted
Date: 2026-07-05
Context
MyGO exposes REST today and is designed to support additional protocols. Business services need contracts that transport adapters can reuse.
Decision
- Services return domain results and
model.AppErrorvalues. - HTTP handlers own REST response DTOs.
internal/apimaps domain error kinds to REST responses.- HTTP packages obtain application behavior through service contracts and authenticated principals.
- Architecture tests enforce the package dependency boundaries.
Consequences
- Additional protocol adapters can reuse the existing services.
- Each protocol adapter defines its own response mapping.
- Service tests exercise business behavior without constructing HTTP requests.
- Error responses can include
error.log_idfor failures recorded by the server.