This commit is contained in:
wangchuxiao
2023-05-09 11:35:59 +08:00
parent f5c80ffd50
commit 22e0fc216b
3 changed files with 8 additions and 6 deletions
+2 -2
View File
@@ -16,10 +16,10 @@ import (
)
func GrpcClient() grpc.DialOption {
return grpc.WithUnaryInterceptor(rpcClientInterceptor)
return grpc.WithUnaryInterceptor(RpcClientInterceptor)
}
func rpcClientInterceptor(ctx context.Context, method string, req, resp interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error) {
func RpcClientInterceptor(ctx context.Context, method string, req, resp interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error) {
if ctx == nil {
return errs.ErrInternalServer.Wrap("call rpc request context is nil")
}