golang-im聊天
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

14 regels
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. }