Documentation
¶
Overview ¶
Package main demonstrates go-kit best practices:
- Pure business logic separated from transport
- Fluent endpoint.Builder for middleware assembly
- NewJSONServer for zero-boilerplate HTTP handling
- MetricsMiddleware for built-in request counters
- Graceful shutdown
Run:
go run ./examples/best_practice
Test:
curl -X POST http://localhost:8080/hello \
-H "Content-Type: application/json" \
-d '{"name":"Alice"}'
curl http://localhost:8080/metrics
Click to show internal directories.
Click to hide internal directories.