transport

package
v0.0.0-...-863def0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorHandler

type ErrorHandler interface {
	Handle(ctx context.Context, err error)
}

ErrorHandler receives a transport error to be processed for diagnostic purposes. Usually this means logging the error.

type ErrorHandlerFunc

type ErrorHandlerFunc func(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.

func (ErrorHandlerFunc) Handle

func (f ErrorHandlerFunc) Handle(ctx context.Context, err error)

Handle calls f(ctx, err).

type LogErrorHandler

type LogErrorHandler struct {
	// contains filtered or unexported fields
}

LogErrorHandler is a transport error handler implementation which logs an error.

func NewLogErrorHandler

func NewLogErrorHandler(logger log.Logger) *LogErrorHandler

NewLogErrorHandler new log error handler.

func (*LogErrorHandler) Handle

func (h *LogErrorHandler) Handle(ctx context.Context, err error)

Handle impl ErrorHandler Handle func.

Directories

Path Synopsis
Package grpc provides a gRPC binding for endpoints.
Package grpc provides a gRPC binding for endpoints.
Package http provides a general purpose HTTP binding for endpoints.
Package http provides a general purpose HTTP binding for endpoints.

Jump to

Keyboard shortcuts

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