golang-im聊天
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

14 lines
330 B

  1. package rpc
  2. import (
  3. "context"
  4. "gim/pkg/gerrors"
  5. "google.golang.org/grpc"
  6. )
  7. func interceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
  8. err := invoker(ctx, method, req, reply, cc, opts...)
  9. return gerrors.WrapRPCError(err)
  10. }