ExRets v0.1.1 ExRets View Source

RETS client for Elixir.

Link to this section Summary

Types

RETS client.

Options for the RETS client.

Details about why an error occurred.

Functions

Open an HTTP client and log in to a RETS server.

Logout and close the HTTP client.

Perform a RETS search.

Link to this section Types

Link to this opaque

client()

View Source (opaque) (since 0.1.0)
client()

RETS client.

Link to this type

opts()

View Source (since 0.1.0)
opts() :: [{:timeout, integer()}]

Options for the RETS client.

Link to this type

reason()

View Source (since 0.1.0)
reason() :: any()

Details about why an error occurred.

Link to this section Functions

Link to this function

login(credentials, opts \\ [])

View Source (since 0.1.0)
login(ExRets.Credentials.t(), opts()) ::
  {:ok, client()} | {:ok, ExRets.HttpResponse.t()} | {:error, reason()}

Open an HTTP client and log in to a RETS server.

Returns an :ok tuple with either a client/0 if the login succeeds, or an ExRets.HttpResponse.t/0 if the login attempt ends with a non-200 status code.

An :error tuple is returned for any other issues.

Options

  • :timeout - HTTP timeout in seconds, applied to each HTTP request by the client.
Link to this function

logout(rets_client)

View Source (since 0.1.0)
logout(client()) ::
  {:ok, ExRets.RetsResponse.t()}
  | {:ok, ExRets.HttpResponse.t()}
  | {:error, reason()}

Logout and close the HTTP client.

Returns an :ok tuple with either a ExRets.RetsResponse.t/0 if the logout succeeds, or an ExRets.HttpResponse.t/0 if the logout ends with a non-200 status code.

An :error tuple is returned for any other issues.

Link to this function

search(rets_client, search_arguments)

View Source (since 0.1.0)
search(client(), ExRets.SearchArguments.t()) ::
  {:ok, ExRets.RetsResponse.t()}
  | {:ok, ExRets.HttpResponse.t()}
  | {:error, reason()}

Perform a RETS search.

Returns an :ok tuple with either a ExRets.RetsResponse.t/0 if the search succeeds, or an ExRets.HttpResponse.t/0 if the search ends with a non-200 status code.

An :error tuple is returned for any other issues.