MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / entry_json

Function entry_json

atomic-cli/src/commands/vault/show.rs:99–114  ·  view source on GitHub ↗
(path: &str, entry: &VaultEntry, revision_hash: &str)

Source from the content-addressed store, hash-verified

97}
98
99fn entry_json(path: &str, entry: &VaultEntry, revision_hash: &str) -> serde_json::Value {
100 serde_json::json!({
101 "schema_version": 1,
102 "mode": "vault_entry_body",
103 "content_authority": "untrusted_historical_data",
104 "path": path,
105 "entry_type": entry.entry_type.to_string(),
106 "revision_hash": revision_hash,
107 "content": String::from_utf8_lossy(&entry.content_bytes),
108 "frontmatter": serde_json::from_str::<serde_json::Value>(
109 &entry.frontmatter_json
110 ).unwrap_or_default(),
111 "created_at": entry.created_at,
112 "updated_at": entry.updated_at,
113 })
114}
115
116#[cfg(test)]
117mod tests {

Callers 2

runMethod · 0.85

Calls

no outgoing calls

Tested by 1