PubNux v0.0.1 PubNux.Client View Source

Wraps http client for the PubNub API

Link to this section Summary

Functions

Calls the provided service in the PubNub API. Here, resource represents a PubNub service, for instance the structure %PubNux.Subscription{} builds the request params requred for PubNub

Link to this section Types

Link to this type http_bad_request_response() View Source
http_bad_request_response() :: {:error, String.t, [{:code, Integer.t}]}
Link to this type http_error_response() View Source
http_error_response() :: {:error, String.t}
Link to this type http_response() View Source
http_response() :: {:ok, String.t}

Link to this section Functions

Link to this function perform_request(resource) View Source
perform_request(any) ::
  {:ok, http_response} |
  {:error, http_error_response | http_bad_request_response}

Calls the provided service in the PubNub API. Here, resource represents a PubNub service, for instance the structure %PubNux.Subscription{} builds the request params requred for PubNub.

## Examples

iex> Config.build()
...> |> Subscription.build(subs_keyword)
...> |> Client.perform_request()
{:ok, "defaultCallback([[],"14957412179337572"])"}


iex> Config.build()
...> |> Publication.build(subs_keyword)
...> |> Client.perform_request()
{:ok, "defaultCallback([[],"14957412179337572"])"}