Skip to main content

Crate alpaca_mock

Crate alpaca_mock 

Source
Expand description

Mock server support for alpaca-rust trade mainline flows.

The crate exposes a runnable binary, alpaca-mock, and a thin library surface for integration tests that need to boot the mock server in-process.

Runtime configuration:

  • ALPACA_MOCK_LISTEN_ADDR defaults to 127.0.0.1:3847
  • market-data-backed flows use ALPACA_DATA_API_KEY and ALPACA_DATA_SECRET_KEY
let server = alpaca_mock::spawn_test_server().await;
assert!(server.base_url.starts_with("http://"));

Re-exports§

pub use app::build_app;
pub use app::build_app_from_env;
pub use app::build_app_with_state;
pub use state::AdminStateResponse;
pub use state::DEFAULT_STOCK_SYMBOL;
pub use state::InjectedHttpFault;
pub use state::InstrumentSnapshot;
pub use state::LiveMarketDataBridge;
pub use state::MarketDataBridgeError;
pub use state::MockServerState;

Modules§

app
handlers
state

Structs§

TestServer

Constants§

BINARY_NAME

Functions§

spawn_test_server
spawn_test_server_with_state