MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / write_all

Function write_all

crates/opencode-mcp/src/auth.rs:69–77  ·  view source on GitHub ↗

Write the entire auth store to disk (creates parent dirs as needed).

(data: &HashMap<String, AuthEntry>)

Source from the content-addressed store, hash-verified

67
68/// Write the entire auth store to disk (creates parent dirs as needed).
69async fn write_all(data: &HashMap<String, AuthEntry>) -> Result<(), std::io::Error> {
70 let path = auth_file_path();
71 if let Some(parent) = path.parent() {
72 fs::create_dir_all(parent).await?;
73 }
74 let json = serde_json::to_string_pretty(data)
75 .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
76 fs::write(&path, json).await
77}
78
79// ---------------------------------------------------------------------------
80// Public API – mirrors TS McpAuth namespace

Callers 2

setFunction · 0.85
removeFunction · 0.85

Calls 2

auth_file_pathFunction · 0.85
newFunction · 0.85

Tested by

no test coverage detected