Packages

An Elixir `plug` library for extending an HTTP server with JSONRPC 2.0 protocol services. It's HTTP transport level. For use both in the Phoenix application and pure `plug`-compatable server.

Current section

Files

Jump to
jsonrpc2_plug lib jsonrpc2_plug response.ex
Raw

lib/jsonrpc2_plug/response.ex

defmodule JSONRPC2Plug.Response do
@type id :: String.t() | number() | nil
@type method :: String.t()
@type params :: list() | map()
@type t :: %__MODULE__{
id: id(),
result: term(),
jsonrpc: String.t()
}
defstruct [:id, :result, jsonrpc: "2.0"]
@spec new(id(), term()) :: t()
def new(id, result),
do: %__MODULE__{id: id, result: result}
end