View Source PhxJsonRpc.Types (Phoenix JSON RPC v0.7.0)

Type definitions for the rpc requests, responses and errors.

Summary

Types

Type represents jsonrpc version number.

Type represents possible rpc errors.

Type represents rpc request ID. Whether it's nil, string or number.

Type represents called rpc request method in the form of string.

Type represents rpc request parameters. In terms of elixir, it's a list or a map.

Type represents rpc response.

Functions

Parses parameters, applying them to the given struct, falling back to defaults for the rest.

Types

@type jsonrpc_version() :: binary()

Type represents jsonrpc version number.

Type represents possible rpc errors.

@type rpc_request_id() :: nil | binary() | number()

Type represents rpc request ID. Whether it's nil, string or number.

@type rpc_request_method() :: binary()

Type represents called rpc request method in the form of string.

@type rpc_request_params() :: [map()] | map()

Type represents rpc request parameters. In terms of elixir, it's a list or a map.

@type rpc_response() :: any()

Type represents rpc response.

Functions

Link to this function

parse_params(struct, params \\ [])

View Source
@spec parse_params(
  struct(),
  Keyword.t()
) :: any()

Parses parameters, applying them to the given struct, falling back to defaults for the rest.