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.

interceptor.go 330 B

2 年之前
12345678910111213
  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. }