View Source euneus_decoder (euneus v0.4.0)

Decode JSON to Erlang terms.

Summary

Types

-type error_class() :: error | exit | throw.
-type error_handler() :: fun((error_class(), error_reason(), error_stacktrace()) -> error_stacktrace()).
-type error_reason() ::
    unexpected_end_of_input |
    {unexpected_byte, binary(), position()} |
    {unexpected_sequence, binary(), position()}.
-type error_stacktrace() :: erlang:stacktrace().
-type input() :: binary() | iolist().
-type normalizer(Term) :: fun((Term, options()) -> term()).
-type options() ::
    #{null_term => term(),
      keys => normalizer(Key :: binary()),
      values => normalizer(Value :: binary()),
      arrays => normalizer(Array :: list()),
      objects => normalizer(Object :: map()),
      error_handler => error_handler()}.
-type position() :: non_neg_integer().
-type result() :: {ok, term()} | {error, error_reason()}.

Functions

-spec decode(Input, Opts) -> Result when Input :: input(), Opts :: options(), Result :: result().
Link to this function

handle_error(Class, Reason, Stacktrace)

View Source
Link to this function

resume(Token, Rest0, Opts, Input, Pos0, Buffer)

View Source
Link to this function

resume(Token, Replacement, Rest0, Opts, Input, Pos0, Buffer)

View Source