IrohBeam.Endpoint (iroh_beam v0.2.0)

View Source

Supervised ownership and lifecycle for one embedded Iroh endpoint.

Each endpoint is an OTP process with its own private identity and native resource. :direct uses no relay or address-lookup infrastructure; :n0 uses Iroh's public defaults; :no_relay keeps n0 address lookup but disables relays; and {:custom, relays} uses only the supplied relay records.

Summary

Types

server()

@type server() :: GenServer.server()

Functions

accept(endpoint, options \\ [])

@spec accept(
  server(),
  keyword()
) :: {:ok, IrohBeam.Connection.t()} | {:error, IrohBeam.Error.t()}

addr(endpoint)

@spec addr(server()) ::
  {:ok, IrohBeam.EndpointAddr.t()} | {:error, IrohBeam.Error.t()}

await_online(endpoint)

@spec await_online(server()) :: :ok | {:error, IrohBeam.Error.t()}

await_online(endpoint, timeout)

@spec await_online(server(), timeout()) :: :ok | {:error, IrohBeam.Error.t()}

bound_sockets(endpoint)

@spec bound_sockets(server()) :: {:ok, [String.t()]} | {:error, IrohBeam.Error.t()}

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

close(endpoint)

@spec close(server()) :: :ok | {:error, IrohBeam.Error.t()}

close(endpoint, timeout)

@spec close(server(), timeout()) :: :ok | {:error, IrohBeam.Error.t()}

connect(endpoint, target, alpn, options \\ [])

id(endpoint)

@spec id(server()) :: {:ok, IrohBeam.EndpointId.t()} | {:error, IrohBeam.Error.t()}

online?(endpoint)

@spec online?(server()) :: boolean()

start_link(options)

@spec start_link(keyword()) :: GenServer.on_start()

status(endpoint)

@spec status(server()) :: {:ok, map()} | {:error, IrohBeam.Error.t()}