diff --git a/pkg/goldpinger/client.go b/pkg/goldpinger/client.go index b913539..2a14f3e 100644 --- a/pkg/goldpinger/client.go +++ b/pkg/goldpinger/client.go @@ -107,6 +107,7 @@ func CheckCluster(ctx context.Context) *models.ClusterHealthResults { return &response } +// PingAllPodsResult holds results from pinging all nodes type PingAllPodsResult struct { podName string podResult models.PodResult @@ -138,6 +139,7 @@ func checkDNS() *models.DNSResults { return &results } +// CheckServicePodsResult results of the /check operation type CheckServicePodsResult struct { podName string checkAllPodResult models.CheckAllPodResult @@ -145,6 +147,7 @@ type CheckServicePodsResult struct { podIPv4 strfmt.IPv4 } +// CheckAllPods calls all neighbours and returns a detailed report func CheckAllPods(checkAllCtx context.Context, pods map[string]*GoldpingerPod) *models.CheckAllResults { result := models.CheckAllResults{Responses: make(map[string]models.CheckAllPodResult)} @@ -247,6 +250,7 @@ func CheckAllPods(checkAllCtx context.Context, pods map[string]*GoldpingerPod) * return &result } +// HealthCheck returns a simple 200 OK response to verify the API is up func HealthCheck() *models.HealthCheckResults { ok := true start := time.Now()