middleware

package
v2.1.3-Pre1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Panic handler prints the stack trace when recovering from a panic.
	RecoveryCustomFunc grpc_recovery.RecoveryHandlerFunc = grpc_recovery.RecoveryHandlerFunc(func(p interface{}) error {
		buf := bytes.NewBuffer(debug.Stack())
		log.Error("Panic attack :", zap.Error(errors.New(buf.String())))
		return status.Errorf(codes.Internal, "%s", p)
	})
	// Shared options for the logger, with a custom gRPC code to log level function.
	Opts = []grpc_recovery.Option{
		grpc_recovery.WithRecoveryHandler(RecoveryCustomFunc),
	}
	UnaryServerInterceptor = grpc_recovery.UnaryServerInterceptor(Opts...)
	GrpcServerOption       grpc.ServerOption
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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