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

Function load_endpoint

crates/openshell-server/src/service_routing.rs:410–424  ·  view source on GitHub ↗
(
    store: &Store,
    sandbox_name: &str,
    service_name: &str,
)

Source from the content-addressed store, hash-verified

408}
409
410async fn load_endpoint(
411 store: &Store,
412 sandbox_name: &str,
413 service_name: &str,
414) -> Result<ServiceEndpoint, ServiceRouteError> {
415 let key = endpoint_key(sandbox_name, service_name);
416 store
417 .get_message_by_name::<ServiceEndpoint>(&key)
418 .await
419 .map_err(|err| {
420 warn!(error = %err, endpoint = %key, "sandbox service routing: failed to load service endpoint");
421 ServiceRouteError::internal_error()
422 })?
423 .ok_or_else(ServiceRouteError::endpoint_not_found)
424}
425
426fn build_upstream_request(
427 req: Request<Body>,

Callers 1

proxy_to_endpointFunction · 0.85

Calls 1

endpoint_keyFunction · 0.85

Tested by

no test coverage detected