Rifle v0.1.0 Rifle View Source

Starts a pool of connections.

Link to this section Summary

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function delete(svc_name, path, body, headers \\ [], req_opts \\ %{}) View Source
Link to this function get(svc_name, path, headers \\ [], req_opts \\ %{}) View Source

Uses svc_name pool to get path.

Options:

  • svc_name - Name of the pool.
  • path - Path without the domain given while starting the pool.
  • headers - List of tuples(with binaries) which will be passed as custom headers.
  • req_opts - Options given to Gun. Has a :timeout of 10 seconds as default.
Link to this function head(svc_name, path, body, headers \\ [], req_opts \\ %{}) View Source

Callback invoked to start the supervisor and during hot code upgrades.

Developers typically invoke Supervisor.init/2 at the end of their init callback to return the proper supervision flags.

Callback implementation for Supervisor.init/1.

Link to this function options(svc_name, path, body, headers \\ [], req_opts \\ %{}) View Source
Link to this function post(svc_name, path, body, headers \\ [], req_opts \\ %{}) View Source

Options:

  • Same as get/4
  • body needs to be binary, which will be passed as POST body.
Link to this function put(svc_name, path, body, headers \\ [], req_opts \\ %{}) View Source
Link to this function request(svc_name, method, path, body, headers \\ [], req_opts \\ %{}) View Source

Can make any custom request with any HTTP method. For all the http functions, this method is used internally.

Options:

  • method can be GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE
  • Other options are same as post/5