gprc grpc_middleware.WithUnaryServerChain 链式调用
opts := []grpc.ServerOption{
//grpc.Creds(c),
grpc_middleware.WithUnaryServerChain(
RecoveryInterceptor,
LoggingInterceptor,
),
}
server := grpc.NewServer(opts...)
pb.RegisterSearchServiceServer(server, &SearchService{})
链式调用, 日志打印方式
RecoveryInterceptor before
LoggingInterceptor brefore
LoggingInterceptor after
RecoveryInterceptor after
conn, err := grpc.Dial(":"+PORT, grpc.WithTransportCredentials(insecure.NewCredentials()))