Skir.RPC.Plug (skir_elixir_client v0.2.2)

Copy Markdown View Source

Plug/Phoenix adapter for Skir.RPC.Service with no hard dependency on Plug.

Use it from Phoenix with forward "/rpc", Skir.RPC.Plug, service: &MyApp.RPC.service/0. Plug must be present in the host application.

Summary

Functions

Handles GET and POST requests using the configured service. POST bodies are bounded before parsing.

Accepts the adapter options. The :service option is required; :metadata may be an arity-1 function.

Functions

call(conn, opts)

@spec call(term(), keyword()) :: term()

Handles GET and POST requests using the configured service. POST bodies are bounded before parsing.

init(opts)

@spec init(keyword()) :: keyword()

Accepts the adapter options. The :service option is required; :metadata may be an arity-1 function.