grpc_recovery2

package
v0.0.0-...-6e21e7b Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

helper recovery, RecoveryHandlerFunc spit UnaryRecoveryHandlerFunc and StreamRecoveryHandlerFunc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRecoveryServer

func NewRecoveryServer(unaryCustomFunc UnaryRecoveryHandlerFunc, streamCustomFunc StreamRecoveryHandlerFunc) *grpc.Server

Initialization shows an initialization sequence with a custom recovery handler func.

func NewRecoveryServer2

func NewRecoveryServer2(unaryCustomFunc UnaryRecoveryHandlerFunc, unaryCustomFunc2 UnaryRecoveryHandlerFunc, streamCustomFunc StreamRecoveryHandlerFunc) *grpc.Server

Initialization shows an initialization sequence with a custom recovery handler func.

func StreamServerInterceptor

func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor

StreamServerInterceptor returns a new streaming server interceptor for panic recovery.

func UnaryServerInterceptor

func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor

UnaryServerInterceptor returns a new unary server interceptor for panic recovery.

Types

type Option

type Option func(*options)

func WithStreamRecoveryHandler

func WithStreamRecoveryHandler(f StreamRecoveryHandlerFunc) Option

WithStreamRecoveryHandler customizes the function for recovering from a panic.

func WithUnaryRecoveryHandler

func WithUnaryRecoveryHandler(f UnaryRecoveryHandlerFunc) Option

WithUnaryRecoveryHandler customizes the function for recovering from a panic.

func WithUnaryRecoveryHandler2

func WithUnaryRecoveryHandler2(f UnaryRecoveryHandlerFunc) Option

type StreamRecoveryHandlerFunc

type StreamRecoveryHandlerFunc func(stream grpc.ServerStream, p interface{}) (err error)

type UnaryRecoveryHandlerFunc

type UnaryRecoveryHandlerFunc func(ctx context.Context, p interface{}) (err error)

RecoveryHandlerFunc is a function that recovers from the panic `p` by returning an `error`.

Jump to

Keyboard shortcuts

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