View Source euneus_encoder (euneus v1.2.1)
JSON generator.
Copyright 2023 William Fank Thomé
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.Summary
Functions
Generates a JSON from Erlang term.
Generates a JSON from Erlang term.
See also: euneus_encoder:parse_opts/1.
Types
-type encoder(Input) :: fun((Input, parsed_options()) -> iolist()).
-type error_class() :: error | exit | throw.
-type error_handler() :: fun((error_class(), error_reason(), error_stacktrace()) -> error_stacktrace()).
-type error_reason() :: unsupported_type_error() | invalid_byte_error().
-type error_stacktrace() :: erlang:stacktrace().
-type escaper(Input) :: fun((Input, parsed_options()) -> iolist()).
-type input() :: term().
-type invalid_byte_error() :: {invalid_byte, Byte :: byte(), Input :: binary()}.
-type options() :: map().
-type parsed_options() :: #opts{}.
-type plugin() ::
datetime | inet | pid | port | proplist | reference | timestamp | drop_nulls | module().
-type result() :: {ok, iolist()} | {error, error_reason()}.
-type unsupported_type_error() :: {unsupported_type, Unsupported :: term()}.
Functions
-spec encode_parsed(input(), parsed_options()) -> result().
See also: euneus_encoder:parse_opts/1.
-spec parse_opts(options()) -> parsed_options().
Parses euneus_encoder:options()
to euneus_encoder:parsed_options()
.