-
Notifications
You must be signed in to change notification settings - Fork 2
/
healthcheck.go
47 lines (41 loc) · 1.18 KB
/
healthcheck.go
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Code generated by goagen v1.4.3, DO NOT EDIT.
//
// API "vulcan-results": healthcheck Resource Client
//
// Command:
// $ goagen
// --design=github.com/adevinta/vulcan-results/design
// --out=/Users/manel.montilla/develop/vulcan-results
// --version=v1.4.3
package client
import (
"context"
"fmt"
"net/http"
"net/url"
)
// ShowHealthcheckPath computes a request path to the show action of healthcheck.
func ShowHealthcheckPath() string {
return fmt.Sprintf("/healthcheck")
}
// Get the health status for the application
func (c *Client) ShowHealthcheck(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewShowHealthcheckRequest(ctx, path)
if err != nil {
return nil, err
}
return c.Client.Do(ctx, req)
}
// NewShowHealthcheckRequest create the request corresponding to the show action endpoint of the healthcheck resource.
func (c *Client) NewShowHealthcheckRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
scheme = "http"
}
u := url.URL{Host: c.Host, Scheme: scheme, Path: path}
req, err := http.NewRequestWithContext(ctx, "GET", u.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}