forked from nokia/restful
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_ping.go
More file actions
25 lines (21 loc) · 764 Bytes
/
client_ping.go
File metadata and controls
25 lines (21 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2021-2024 Nokia
// Licensed under the BSD 3-Clause License.
// SPDX-License-Identifier: BSD-3-Clause
package restful
import "context"
// PingList sends a HTTP GET requests to a list of URLs and expects 2xx responses for each.
// This way one can check liveness components.
func (c *Client) PingList(ctx context.Context, targets []string) error {
for _, url := range targets {
err := c.Get(ctx, url, nil)
if err != nil {
return DetailError(err, "error checking url "+url)
}
}
return nil
}
// PingList sends a HTTP GET requests to a list of URLs and expects 2xx responses for each.
// This way one can check liveness components.
func PingList(ctx context.Context, targets []string) error {
return defaultClient.PingList(ctx, targets)
}