best_practice

command
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 17 Imported by: 0

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

Jump to

Keyboard shortcuts

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