(
state: &Arc<ServerState>,
request: Request<GetServiceRequest>,
)
| 125 | } |
| 126 | |
| 127 | pub(super) async fn handle_get_service( |
| 128 | state: &Arc<ServerState>, |
| 129 | request: Request<GetServiceRequest>, |
| 130 | ) -> Result<Response<ServiceEndpointResponse>, Status> { |
| 131 | let req = request.into_inner(); |
| 132 | validate_endpoint_name("sandbox", &req.sandbox, MAX_SANDBOX_NAME_LEN)?; |
| 133 | validate_optional_endpoint_name("service", &req.service, MAX_SERVICE_NAME_LEN)?; |
| 134 | |
| 135 | let endpoint = get_service_endpoint(state, &req.sandbox, &req.service) |
| 136 | .await? |
| 137 | .ok_or_else(|| Status::not_found("service endpoint not found"))?; |
| 138 | |
| 139 | Ok(Response::new(service_endpoint_response(state, endpoint))) |
| 140 | } |
| 141 | |
| 142 | pub(super) async fn handle_list_services( |
| 143 | state: &Arc<ServerState>, |
no test coverage detected