Split the 657-line operation service into eor, submit, and verify modules, add the AGENT_REVOKED and KEY_RETIRED codes the Backend already emits, and condense every multi-line comment. Mirror Node, Python, and Go at 2.1.0 with the deep-health 503, non-idempotent retry, rotation grace, and path-encoding fixes. Document which routes and response fields the self-hosted server does not provide. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
30 lines
702 B
Go
30 lines
702 B
Go
package elydora
|
|
|
|
import "net/http"
|
|
|
|
// Health checks the public health endpoint.
|
|
func Health(baseURL string) (*HealthResponse, error) {
|
|
var result HealthResponse
|
|
if err := publicRequest(http.MethodGet, normalizeBaseURL(baseURL)+"/v1/health", nil, &result); err != nil {
|
|
return nil, err
|
|
}
|
|
return &result, nil
|
|
}
|
|
|
|
// DeepHealth checks backend dependencies; 503 reports a degraded API.
|
|
func DeepHealth(baseURL string) (*DeepHealthResponse, error) {
|
|
var result DeepHealthResponse
|
|
err := publicRequest(
|
|
http.MethodGet,
|
|
normalizeBaseURL(baseURL)+"/v1/health/deep",
|
|
nil,
|
|
&result,
|
|
http.StatusOK,
|
|
http.StatusServiceUnavailable,
|
|
)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &result, nil
|
|
}
|