ExUtcp.Transports.WebRTC.Testable (ex_utcp v0.3.2)

Copy Markdown View Source

Testable version of WebRTC transport that can use mocks.

Summary

Functions

Returns a specification to start this module under a supervisor.

Clear mocks after testing.

Get the connection module (real or mock).

Creates a new testable WebRTC transport.

Set mocks for testing.

Starts the testable WebRTC transport GenServer.

Types

t()

@type t() :: %ExUtcp.Transports.WebRTC.Testable{
  connection_module: module(),
  connection_timeout: non_neg_integer(),
  connections: %{required(String.t()) => pid()},
  genserver_module: module(),
  ice_servers: [map()],
  providers: %{required(String.t()) => map()},
  signaling_server: String.t()
}

Functions

call_tool(transport, tool_name, args, provider)

call_tool_stream(transport, tool_name, args, provider)

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear_mocks()

Clear mocks after testing.

close(transport)

deregister_tool_provider(transport, provider)

get_connection_module()

Get the connection module (real or mock).

new(opts \\ [])

@spec new(keyword()) :: t()

Creates a new testable WebRTC transport.

register_tool_provider(transport, provider)

set_mocks(connection_module)

Set mocks for testing.

start_link(opts \\ [])

@spec start_link(keyword()) :: {:ok, pid()} | {:error, term()}

Starts the testable WebRTC transport GenServer.