You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: health_check_configurer.go
    path of file: ./repos/kuma/pkg/xds/envoy/clusters/v3
    
    the code of the file until where you have to start completion: package clusters

import (
	"encoding/hex"

	envoy_cluster "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
	envoy_core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
	envoy_type "github.com/envoyproxy/go-control-plane/envoy/type/v3"
	"github.com/pkg/errors"
	"google.golang.org/protobuf/types/known/wrapperspb"

	mesh_proto "github.com/kumahq/kuma/api/mesh/v1alpha1"
	"github.com/kumahq/kuma/pkg/core"
	core_mesh "github.com/kumahq/kuma/pkg/core/resources/apis/mesh"
	util_proto "github.com/kumahq/kuma/pkg/util/proto"
)

type HealthCheckConfigurer struct {
	HealthCheck *core_mesh.HealthCheckResource
	Protocol    core_mesh.Protocol
}

var _ ClusterConfigurer = &HealthCheckConfigurer{}

func mapUInt32ToInt64Range(value uint32) *envoy_type.Int64Range {
	retur
    
func (e *HealthCheckConfigurer) Configure(cluster *envoy_cluster.Cluster) error {
	if e.HealthCheck == nil || e.HealthCheck.Spec.Conf == nil {
		return nil
	}

	activeChecks := e.HealthCheck.Spec.Conf

	healthPanicThreshold(cluster, activeChecks.GetHealthyPanicThreshold())
	failTrafficOnPanic(cluster, activeChecks.GetFailTrafficOnPanic())

	tcp := activeChecks.GetTcp()
	http := activeChecks.GetHttp()

	if tcp == nil && http == nil {
		cluster.HealthChecks = append(cluster.HealthChecks, buildHealthCheck(activeChecks))

		return nil
	}

	if tcp != nil {
		defaultHealthCheck := buildHealthCheck(activeChecks)
		healthChecker := tcpHealthCheck(tcp)
		healthCheck := addHealthChecker(defaultHealthCheck, healthChecker)

		cluster.HealthChecks = append(cluster.HealthChecks, healthCheck)
	}

	if http != nil {
		defaultHealthCheck := buildHealthCheck(activeChecks)
		healthChecker := httpHealthCheck(e.Protocol, http)
		healthCheck := addHealthChecker(defaultHealthCheck, healthChecker)

		cluster.HealthChecks = append(cluster.HealthChecks, healthCheck)
	}

	return nil
}