2️⃣ README
# api-test
Minimal Go API using **Gin + SQLite + worker queue**.
## Stack
- Go `1.22`
- Gin (`github.com/gin-gonic/gin`)
- SQLite (modernc.org/sqlite)
- Worker queue (internal/worker)
- Tests for handlers + queue, benchmarks for queue
## Quickstart
```bash
go mod download
go run ./cmd/apiCreate task POST /tasks Request:
{ "title": "Buy milk" }
201 Created – {"id":1,"title":"Buy milk","done":false} 400 Bad Request – invalid JSON or missing title 500 Internal Server Error – DB error List tasks GET /tasks
Response:
[
{ "id": 1, "title": "Buy milk", "done": false }
]GET /tasks/:id 200 OK – task JSON 400 Bad Request – invalid ID 404 Not Found – missing task
PUT /tasks/:id Request:
{
"title": "Buy eggs",
"done": true
}200 OK – updated task 400/404 on invalid ID or missing task
DELETE /tasks/:id 204 No Content – removed 404 Not Found – missing task
Local test commands:
go test ./... -count=1 -v
go test ./internal/handlers -count=1 -v
go test ./internal/worker -count=1 -v
In CI (Linux), tests also run with -race.