Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewUnaryClientInterceptor ¶
func NewUnaryClientInterceptor() grpc.UnaryClientInterceptor
grpc server端 的异常只支持 code 与 description, 为了能完整把异常传递给下游调用方, 把异常放到了grpc response header中 客户端如果发现有这个key 说明该异常是我们定义的业务异常对象(API Exception), 需要还原。
Types ¶
type UnaryClientInterceptor ¶
type UnaryClientInterceptor struct { }
func (*UnaryClientInterceptor) UnaryClientInterceptor ¶
func (e *UnaryClientInterceptor) UnaryClientInterceptor( ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
Click to show internal directories.
Click to hide internal directories.