mirror of
https://github.com/passbolt/go-passbolt.git
synced 2025-09-13 14:29:09 +00:00
move api package to sub folder
This commit is contained in:
parent
ff29c83d56
commit
ff1be787f2
23 changed files with 61 additions and 61 deletions
26
api/healthcheck.go
Normal file
26
api/healthcheck.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// PerformHealthCheck performs a Health Check
|
||||
func (c *Client) PerformHealthCheck(ctx context.Context) (json.RawMessage, error) {
|
||||
msg, err := c.DoCustomRequest(ctx, "GET", "/healthcheck.json", "v2", nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return msg.Body, nil
|
||||
}
|
||||
|
||||
// GetHealthCheckStatus gets the Server Status
|
||||
func (c *Client) GetHealthCheckStatus(ctx context.Context) (string, error) {
|
||||
msg, err := c.DoCustomRequest(ctx, "GET", "/healthcheck/status.json", "v2", nil, nil)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return string(msg.Body), nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue