crud

command
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 12 Imported by: 0

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

Overview

Command crud runs the complete in-memory Kora CRUD example.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL