/
healthcheck.go
44 lines (38 loc) · 1.05 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
// Code generated by goagen v1.4.0, DO NOT EDIT.
//
// API "vulcan-persistence": healthcheck Resource Client
//
// Command:
// $ gen
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("/v1/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.NewRequest("GET", u.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}