Documentation ¶
Overview ¶
* user define interceptor
Index ¶
- func PostHandler(ctx context.Context, req interface{}, resp interface{}, err error)
- func RequestInfoExtract(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo) context.Context
- func UnaryRequestInfoInterceptor(handlerFunc BeforeHandlerFunc, afterHandlerFunc AfterHandlerFunc) grpc.UnaryServerInterceptor
- type AfterHandlerFunc
- type BeforeHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PostHandler ¶
Default AfterHandlerFunc Log request and response information if error not nil
func RequestInfoExtract ¶
func RequestInfoExtract(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo) context.Context
Default BeforeHandlerFunc Extract request information from metadata then set them to context
func UnaryRequestInfoInterceptor ¶
func UnaryRequestInfoInterceptor(handlerFunc BeforeHandlerFunc, afterHandlerFunc AfterHandlerFunc) grpc.UnaryServerInterceptor
UnaryRequestInfoInterceptor returns a unary interceptor to add before/post handler for request. handlerFunc: if nil use default RequestInfoExtract afterHandlerFunc: if nil use default PostHandler
Types ¶
type AfterHandlerFunc ¶
type BeforeHandlerFunc ¶
Click to show internal directories.
Click to hide internal directories.