#[no_mangle]
pub extern "C" fn pactffi_create_mock_server_for_pact(
    pact: PactHandle,
    addr_str: *const c_char,
    tls: bool
) -> i32
Expand description

[DEPRECATED] External interface to create a HTTP mock server. A Pact handle is passed in, as well as the port for the mock server to run on. A value of 0 for the port will result in a port being allocated by the operating system. The port of the mock server is returned.

  • pact - Handle to a Pact model created with created with pactffi_new_pact.
  • addr_str - Address to bind to in the form name:port (i.e. 127.0.0.1:0). Must be a valid UTF-8 NULL-terminated string.
  • tls - boolean flag to indicate of the mock server should use TLS (using a self-signed certificate)

This function is deprecated and replaced with pactffi_create_mock_server_for_transport.

§Errors

Errors are returned as negative values.

ErrorDescription
-1An invalid handle was received. Handles should be created with pactffi_new_pact
-3The mock server could not be started
-4The method panicked
-5The address is not valid
-6Could not create the TLS configuration with the self-signed certificate