Chatto.Connect (chatto v0.1.0)

Copy Markdown View Source

Unary Connect protocol client for Chatto's API.

Service modules in lib/chatto/generated call call/4 with a client from new/3:

client = Chatto.Connect.new(server_url, token)
Chatto.Discovery.V1.ServerDiscoveryService.get_server(client, %Chatto.Discovery.V1.GetServerRequest{})

Summary

Functions

Builds a client for Chatto's Connect API authenticated with token.

Functions

call(client, procedure, request, response_module)

@spec call(Req.Request.t(), String.t(), struct(), module()) ::
  {:ok, struct()} | {:error, Chatto.Connect.Error.t()}

new(base_url, token, opts \\ [])

@spec new(String.t(), String.t(), keyword()) :: Req.Request.t()

Builds a client for Chatto's Connect API authenticated with token.

opts are merged into the request as Req options. Pass request: to build on an existing Req.Request, such as one with tracing steps attached.