package discovery import ( "context" "google.golang.org/grpc/health/grpc_health_v1" ) // HealthServer 实现健康检查 type HealthServer struct { grpc_health_v1.UnimplementedHealthServer // healthy bool } func NewHealthServer() *HealthServer { return &HealthServer{} } func (s *HealthServer) Check(ctx context.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) { return &grpc_health_v1.HealthCheckResponse{ Status: grpc_health_v1.HealthCheckResponse_SERVING, // 或 NOT_SERVING }, nil }