trellis-rs 0.10.8

Curated public Rust facade for Trellis clients and services.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Contract metadata for `trellis.health@v1`.
//! Generated from ./generated/contracts/manifests/trellis.health@v1.json
/// Canonical Trellis contract id.
pub const CONTRACT_ID: &str = "trellis.health@v1";
/// Stable digest for the canonical manifest JSON.
pub const CONTRACT_DIGEST: &str = "RHDzeH2V6Nltzk6WklCLbTIK48hF0hNuO9Qk6-BosT4";
/// Human-readable contract name.
pub const CONTRACT_NAME: &str = "Trellis Health";
/// Canonical manifest JSON embedded in the SDK crate.
pub const CONTRACT_JSON: &str = r#"{"description":"Expose shared Trellis heartbeat events for service observability.","displayName":"Trellis Health","docs":{"markdown":"Defines the heartbeat event services publish so operators can observe service liveness.","summary":"Service heartbeat events."},"events":{"Health.Heartbeat":{"docs":{"markdown":"Emitted by services to report runtime identity, uptime, and health metadata.","summary":"Publish service liveness."},"event":{"schema":"HealthHeartbeat"},"subject":"events.v1.Health.Heartbeat","version":"v1"}},"format":"trellis.contract.v1","id":"trellis.health@v1","kind":"service","schemas":{"HealthHeartbeat":{"properties":{"checks":{"items":{"properties":{"error":{"type":"string"},"info":{"patternProperties":{"^.*$":{}},"type":"object"},"latencyMs":{"type":"number"},"name":{"type":"string"},"status":{"anyOf":[{"const":"ok","type":"string"},{"const":"failed","type":"string"}]},"summary":{"type":"string"}},"required":["name","status","latencyMs"],"type":"object"},"type":"array"},"header":{"properties":{"id":{"type":"string"},"time":{"format":"date-time","type":"string"}},"required":["id","time"],"type":"object"},"service":{"properties":{"contractDigest":{"type":"string"},"contractId":{"type":"string"},"info":{"patternProperties":{"^.*$":{}},"type":"object"},"instanceId":{"type":"string"},"kind":{"anyOf":[{"const":"service","type":"string"},{"const":"device","type":"string"}]},"name":{"type":"string"},"publishIntervalMs":{"minimum":1,"type":"integer"},"runtime":{"anyOf":[{"const":"deno","type":"string"},{"const":"node","type":"string"},{"const":"rust","type":"string"},{"const":"unknown","type":"string"}]},"runtimeVersion":{"type":"string"},"startedAt":{"format":"date-time","type":"string"},"version":{"type":"string"}},"required":["name","kind","instanceId","contractId","contractDigest","startedAt","publishIntervalMs","runtime"],"type":"object"},"status":{"anyOf":[{"const":"healthy","type":"string"},{"const":"unhealthy","type":"string"},{"const":"degraded","type":"string"}]},"summary":{"type":"string"}},"required":["header","service","status","checks"],"type":"object"}}}"#;
/// Deserialize the embedded contract manifest.
pub fn contract_manifest() -> crate::contracts::ContractManifest {
    serde_json::from_str(CONTRACT_JSON).expect("generated manifest json")
}