golang-im聊天
25개 이상의 토픽을 선택하실 수 없습니다. 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. }