MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / store_gateway_metadata

Function store_gateway_metadata

crates/openshell-bootstrap/src/metadata.rs:196–206  ·  view source on GitHub ↗
(name: &str, metadata: &GatewayMetadata)

Source from the content-addressed store, hash-verified

194}
195
196pub fn store_gateway_metadata(name: &str, metadata: &GatewayMetadata) -> Result<()> {
197 let path = user_gateway_metadata_path(name)?;
198 ensure_parent_dir_restricted(&path)?;
199 let contents = serde_json::to_string_pretty(metadata)
200 .into_diagnostic()
201 .wrap_err("failed to serialize gateway metadata")?;
202 std::fs::write(&path, contents)
203 .into_diagnostic()
204 .wrap_err_with(|| format!("failed to write metadata to {}", path.display()))?;
205 Ok(())
206}
207
208/// Return whether a gateway metadata record would resolve from user or system config.
209pub fn gateway_metadata_source(name: &str) -> Result<Option<GatewayMetadataSource>> {

Calls 2