packageserverimport("github.com/go-kratos/kratos/v2/log""github.com/go-kratos/kratos/v2/middleware/recovery""github.com/go-kratos/kratos/v2/middleware/tracing""github.com/go-kratos/kratos/v2/transport/grpc""hilo/api/service/mgr""hilo/app/service/mgr/internal/conf""hilo/app/service/mgr/internal/handler""time")// NewGRPCServer new a gRPC server.funcNewGRPCServer(c*conf.Server,svc*handler.MgrHandler)*grpc.Server{varopts=[]grpc.ServerOption{grpc.Middleware(recovery.Recovery(),tracing.Server(),ValidateParams(),),}ifc.Grpc.Addr!=""{opts=append(opts,grpc.Address(c.Grpc.Addr))}ifc.Grpc.Timeout!=0{opts=append(opts,grpc.Timeout(time.Duration(c.Grpc.Timeout)*time.Second))}srv:=grpc.NewServer(opts...)mgr.RegisterMgrServer(srv,svc)logHelper=log.NewHelper(log.GetLogger())returnsrv}