ErrorHandler receives a transport error to be processed for diagnostic purposes. Usually this means logging the error.
type ErrorHandler interface { Handle(ctx context.Context, err error) }
The ErrorHandlerFunc type is an adapter to allow the use of ordinary function as ErrorHandler. If f is a function with the appropriate signature, ErrorHandlerFunc(f) is a ErrorHandler that calls f.
type ErrorHandlerFunc func(ctx context.Context, err error)
func (f ErrorHandlerFunc) Handle(ctx context.Context, err error)
Handle calls f(ctx, err).
LogErrorHandler is a transport error handler implementation which logs an error.
type LogErrorHandler struct {
// contains filtered or unexported fields
}
func NewLogErrorHandler(logger log.Logger) *LogErrorHandler
func (h *LogErrorHandler) Handle(ctx context.Context, err error)
Name | Synopsis |
---|---|
.. | |
amqp | Package amqp implements an AMQP transport. |
awslambda | Package awslambda provides an AWS Lambda transport layer. |
grpc | Package grpc provides a gRPC binding for endpoints. |
http | Package http provides a general purpose HTTP binding for endpoints. |
jsonrpc | Package jsonrpc provides a JSON RPC (v2.0) binding for endpoints. |
proto | |
httprp | Package httprp provides an HTTP reverse-proxy transport. |
nats | Package nats provides a NATS transport. |