feat(cli): enhance user and hook management with new commands and flags
Some checks failed
CI / Test (1.22) (push) Failing after -22m38s
CI / Test (1.23) (push) Failing after -22m21s
CI / Lint (push) Failing after -22m42s
CI / Build (push) Failing after -23m0s

This commit is contained in:
2026-02-20 21:17:09 +02:00
parent 500db67c72
commit b81febafc9
5 changed files with 529 additions and 171 deletions

View File

@@ -102,6 +102,16 @@ func decodeJSON(resp *http.Response, target interface{}) error {
return json.NewDecoder(resp.Body).Decode(target)
}
// serverAvailable checks if the server is reachable via the health endpoint.
func serverAvailable(client *Client) bool {
resp, err := client.client.Get(client.baseURL + "/health")
if err != nil {
return false
}
resp.Body.Close()
return resp.StatusCode < 500
}
// checkError prints error and exits if error is not nil
func checkError(err error) {
if err != nil {