| api | ||
| build/package | ||
| cmd/api | ||
| db/migrations | ||
| deploy/k8s | ||
| internal | ||
| .editorconfig | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| go.mod | ||
| go.sum | ||
| Makefile | ||
| oapi-codegen.yaml | ||
| README.md | ||
Backoffice API
Backoffice API for my training activities etc. maybe workshops in the future.
API
The API is going to be REST with OpenAPI specification and Swagger (or similar) UI for development. In the future this may change and for example gRPC (Connect RPC 👀).
The API schema resides in the api/ directory.
API and code
The code is generated from API schema, not the other way around (schema from code).
For this, I am using oapi-codegen. The other project considered was ogen. This choice may be review in the future.
My main concern with oapi-codegen is with optional fields, since pointers are used while ogen is utilizing Go's generics. Which I feel may be a better fit.
API versioning
I want to split major versions (⚠️ breaking changes) with folders in code and also in URL path.
This is done mainly to gain experience with such approach.
The first of API scheme iteration is marked as v0, since I expect not to get everything right the first time and I want to try this approach while designing the API. Altho it's just a number and there is no reason between v0, v1, v2,...