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

Method new

crates/opencode-tui/src/api.rs:251–262  ·  view source on GitHub ↗
(base_url: String)

Source from the content-addressed store, hash-verified

249
250impl ApiClient {
251 pub fn new(base_url: String) -> Self {
252 let client = Client::builder()
253 .timeout(std::time::Duration::from_secs(30))
254 .build()
255 .expect("Failed to create HTTP client");
256
257 Self {
258 client,
259 base_url,
260 current_session: Arc::new(RwLock::new(None)),
261 }
262 }
263
264 pub fn create_session(&self, parent_id: Option<String>) -> anyhow::Result<SessionInfo> {
265 let url = format!("{}/session", self.base_url);

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
buildMethod · 0.80

Tested by

no test coverage detected