Files
mxaccessgw/clients/rust/crates/mxgw-cli/src/connect.rs
T
Joseph Doherty 2a91e2b083
ci / nightly-windev (push) Has been skipped
ci / windows-x86 (push) Successful in 1m27s
ci / java (push) Successful in 2m3s
ci / portable (push) Failing after 4m10s
refactor(rust-cli): split mxgw-cli main.rs by command group (mxaccessgw#203)
Pure move: cli definition, per-group handlers (session, bulk, bench, events,
galaxy, smoke, batch) and shared output/parse/connect helpers now live in
their own modules. No behaviour or CLI surface change; --help of all 33
commands is byte-identical, clippy clean, tests unchanged.

Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
2026-11-09 13:17:16 -05:00

22 lines
674 B
Rust

//! Gateway and Galaxy client construction helpers.
use zb_mom_ww_mxgateway_client::{Error, GalaxyClient, GatewayClient};
use crate::cli::*;
pub(crate) async fn connect(connection: ConnectionArgs) -> Result<GatewayClient, Error> {
GatewayClient::connect(connection.options()).await
}
pub(crate) async fn connect_galaxy(connection: ConnectionArgs) -> Result<GalaxyClient, Error> {
GalaxyClient::connect(connection.options()).await
}
pub(crate) async fn session_for(
connection: ConnectionArgs,
session_id: String,
) -> Result<zb_mom_ww_mxgateway_client::Session, Error> {
let client = connect(connection).await?;
Ok(client.session(session_id))
}