command
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: Jul 30, 2026
License: MIT
Opens a new window with license information.
Imports: 12
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
CRUD example
This example is a complete, dependency-free JSON API built with Kora. It uses
an in-memory repository so the application flow remains easy to inspect.
It demonstrates:
- constructor-based dependency injection with an interface binding;
- route groups and named routes;
- JSON binding and explicit validation;
- structured HTTP errors;
- typed environment configuration;
- graceful shutdown;
- integration testing through
net/http.
Run it:
go run ./examples/crud
Optionally change the address:
HTTP_ADDRESS=:9090 go run ./examples/crud
Routes:
GET /users
POST /users
GET /users/{id}
PUT /users/{id}
DELETE /users/{id}
Documentation
¶
Command crud runs the complete in-memory Kora CRUD example.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.