harbor run -t openthoughts/tasktrove-exp-rpt-stack-dockerfile-gpt5mini-v3-stack-dockerfile-gpt4o-0543harbor download openthoughts/tasktrove-exp-rpt-stack-dockerfile-gpt5mini-v3-stack-dockerfile-gpt4o-0543Create a Go project in /app/ that implements a small, well-tested HTTP service and CLI helper. The project must compile with Go 1.16 and use only the Go standard library. Structure and behavior requirements are below.
Project structure (suggested)
Requirements — HTTP server
The server listens on port specified by environment variable PORT. If PORT is not set, default to 8080.
Provide the following endpoints:
GET /health
POST /reverse
GET /metrics
Concurrency & safety:
Graceful shutdown:
Logging:
Requirements — reverse logic
Requirements — CLI utility
Tests
Build & run instructions (these should work inside the given environment)
Behavior examples (these should match your implementation)
curl -sS -X GET http://localhost:8080/health -> {"status":"ok"}
curl -sS -X POST -H "Content-Type: application/json" -d '{"text":"Hello, 世界"}' http://localhost:8080/reverse -> {"reversed":"界世 ,olleH"}
curl -sS -X GET http://localhost:8080/metrics -> {"total_requests":3,"uptime_seconds":12}
echo "hello" | /app/bin/cli -> olleh
Additional constraints
Submission