go/grpshuffle_server/lib/health_server.go (17 lines of code) (raw):
package grpshuffle_server
import (
"context"
"google.golang.org/grpc/codes"
health "google.golang.org/grpc/health/grpc_health_v1" // here
"google.golang.org/grpc/status"
)
type HealthServer struct {
}
func (h *HealthServer) Check(context.Context, *health.HealthCheckRequest) (*health.HealthCheckResponse, error) {
return &health.HealthCheckResponse{
Status: health.HealthCheckResponse_SERVING,
}, nil
}
func (h *HealthServer) Watch(*health.HealthCheckRequest, health.Health_WatchServer) error {
return status.Error(codes.Unimplemented, "watch is not implemented.")
}