github.com/weaviate/weaviate@v1.24.6/adapters/handlers/grpc/v1/health.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  package v1
    13  
    14  import (
    15  	"context"
    16  
    17  	"google.golang.org/grpc/health/grpc_health_v1"
    18  )
    19  
    20  func (s *Service) healthCheck() *grpc_health_v1.HealthCheckResponse {
    21  	return &grpc_health_v1.HealthCheckResponse{Status: grpc_health_v1.HealthCheckResponse_SERVING}
    22  }
    23  
    24  func (s *Service) Check(ctx context.Context, request *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) {
    25  	return s.healthCheck(), nil
    26  }
    27  
    28  func (s *Service) Watch(request *grpc_health_v1.HealthCheckRequest, server grpc_health_v1.Health_WatchServer) error {
    29  	return server.Send(s.healthCheck())
    30  }