Skip to content
Branch: master
Find file History
sagikazarmark and peterbourgon Implement transport level error handlers (#863)
* Add error handler implementation to the log package

* Add error handler to http transport

* Add error handler to amqp transport

* Add error handler to awslambda transport

* Add error handler to grpc transport

* Add error handler to nats transport

* Move error handler interfaces to transport package

* Move log error handler to transport package

* Remove error logger precedence

* Improve documentation wording

* Adjust transport package documentation

* Remove ignore error

* Update examples

* Add context to the error handler signature
Latest commit 3c77e8c Apr 24, 2019

README.md

profilesvc

This example demonstrates how to use Go kit to implement a REST-y HTTP service. It leverages the excellent gorilla mux package for routing.

Run the example with the optional port address for the service:

$ go run ./cmd/profilesvc/main.go -http.addr :8080
ts=2018-05-01T16:13:12.849086255Z caller=main.go:47 transport=HTTP addr=:8080

Create a Profile:

$ curl -d '{"id":"1234","Name":"Go Kit"}' -H "Content-Type: application/json" -X POST http://localhost:8080/profiles/
{}

Get the profile you just created

$ curl localhost:8080/profiles/1234
{"profile":{"id":"1234","name":"Go Kit"}}
You can’t perform that action at this time.