pact_ref_server (pact_erlang v0.3.1)

View Source

Summary

Functions

Public API to create an interaction

Gets consumer and producer for a pact ref

Public API to set the mock server port when the server is started

Gets pact ref generated (when a new pact was created/re-created) by pact ffi

Public API to set the mock server port when the server is started

Sets pact_ref in pact_handler's state

Starts pact server

Stops the pact_handler gen_server for final cleanups

Types

consumer/0

-type consumer() :: binary().

pact_interaction_details/0

-type pact_interaction_details() :: map().

pact_interaction_ref/0

-type pact_interaction_ref() :: integer().

pact_mock_server_port/0

-type pact_mock_server_port() :: undefined | integer().

pact_ref/0

-type pact_ref() :: undefined | integer().

provider/0

-type provider() :: binary().

Functions

create_interaction(PactPid, InteractionRef, Interaction)

-spec create_interaction(pid(), pact_interaction_ref(), pact_interaction_details()) -> ok.

Public API to create an interaction

get_consumer_producer(PactPid)

-spec get_consumer_producer(pid()) -> {consumer(), provider()}.

Gets consumer and producer for a pact ref

get_mock_server_port(PactPid)

-spec get_mock_server_port(pid()) -> pact_mock_server_port().

Public API to set the mock server port when the server is started

get_pact_ref(PactPid)

-spec get_pact_ref(pid()) -> pact_ref().

Gets pact ref generated (when a new pact was created/re-created) by pact ffi

handle_call(_, From, State)

handle_cast(Msg, State)

init(Pact_state)

set_mock_server_port(PactPid, Port)

-spec set_mock_server_port(pid(), pact_mock_server_port()) -> ok.

Public API to set the mock server port when the server is started

set_pact_ref(PactPid, PactRef)

-spec set_pact_ref(pid(), pact_ref()) -> ok.

Sets pact_ref in pact_handler's state

start(Consumer, Producer)

-spec start(consumer(), provider()) -> gen_server:start_ret().

Starts pact server

stop(PactPid)

-spec stop(pid()) -> ok.

Stops the pact_handler gen_server for final cleanups

terminate(Reason, State)