retort v2.7.0 Retort.Client.Request View Source

Metadata about a request that is in-flight for Retort.Client.Generic

Link to this section Summary

Types

The methods supported by the JSON API over JSON RPC servers

t()

Information needed to send the response from the server by the Elixir process

Functions

Translates the method to the corresponding Alembic.FromJson.action

Converts to Alembic.Meta.t with "action" and "sender" set to work with Alembic.FromJson.from_json/2’s error template

Link to this section Types

Link to this type method() View Source
method() ::
  :create |
  :create_relationship |
  :destroy |
  :destroy_relationship |
  :get_related_resource |
  :index |
  :show |
  :show_relationship |
  :update |
  :update_relationship

The methods supported by the JSON API over JSON RPC servers

Link to this type t() View Source
t() :: %Retort.Client.Request{from: {pid(), reference()}, method: method()}

Information needed to send the response from the server by the Elixir process.

  • from the Genserver call identifier to reply to the ELixir client process
  • method - the method of the call. Used to generate Alembic.Meta.t (using to_meta/1) that controls the parsing of the server response.

Link to this section Functions

Link to this function method_to_action(method) View Source
method_to_action(method()) :: Alembic.FromJson.action()

Translates the method to the corresponding Alembic.FromJson.action

Link to this function to_meta(request) View Source
to_meta(t()) :: Alembic.Meta.t()

Converts to Alembic.Meta.t with "action" and "sender" set to work with Alembic.FromJson.from_json/2’s error template.

"sender" is always set to :server since parsing responses from this request will by definition come from a server.