View Source euneus (euneus v0.7.0)

Core module.

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

Equivalent to euneus_smart_decoder:decode / 1.

Equivalent to euneus_decoder:decode / 2.

Equivalent to euneus_decoder:decode_parsed / 2.

Equivalent to euneus_smart_json_encoder:encode / 1.

Equivalent to euneus_encoder:encode / 2.

Equivalent to euneus_smart_html_encoder:encode / 1.

Generates a JSON as erlang:binary() from Erlang term.

Equivalent to euneus_smart_js_encoder:encode / 1.

Generates a JSON as erlang:binary() from Erlang term.

Equivalent to euneus_encoder:encode_parsed / 2.

Generates a JSON as erlang:binary() from Erlang term.

Generates a JSON as erlang:binary() from Erlang term.

See also: euneus_encoder:encode/2.

Equivalent to euneus_smart_unicode_encoder:encode / 1.

Generates a JSON as erlang:binary() from Erlang term.

Equivalent to euneus_decoder:parse_opts / 1.

Equivalent to euneus_encoder:parse_opts / 1.

Types

-type decode_input() :: euneus_decoder:input().
-type decode_opts() :: euneus_decoder:options().
-type decode_result() :: euneus_decoder:result().
-type encode_input() :: euneus_encoder:input().
-type encode_opts() :: euneus_encoder:options().
-type encode_result() :: euneus_encoder:result().
Link to this type

encode_to_bin_result/0

View Source
-type encode_to_bin_result() :: {ok, binary()} | {error, euneus_encoder:error_reason()}.

Functions

-spec decode(Input) -> Result when Input :: decode_input(), Result :: decode_result().

Equivalent to euneus_smart_decoder:decode / 1.

Parses JSON to Erlang term.

See also: euneus_smart_decoder:decode/1.

-spec decode(Input, Opts) -> Result
          when Input :: decode_input(), Opts :: map() | decode_opts(), Result :: decode_result().

Equivalent to euneus_decoder:decode / 2.

Parses JSON to Erlang term.

See also: euneus_decoder:decode/2.

Link to this function

decode_parsed(Input, ParsedOpts)

View Source
-spec decode_parsed(Input, ParsedOpts) -> Result
                 when
                     Input :: decode_input(),
                     ParsedOpts :: decode_opts(),
                     Result :: decode_result().

Equivalent to euneus_decoder:decode_parsed / 2.

Parses JSON to Erlang term.

See also: euneus_decoder:decode_parsed/2.

-spec encode(Input) -> Return when Input :: encode_input(), Return :: encode_result().

Equivalent to euneus_smart_json_encoder:encode / 1.

Generates a JSON from Erlang term.

Uses JSON encoder.

See also: euneus_smart_json_encoder:encode/1.

-spec encode(Input, Opts) -> Return
          when Input :: encode_input(), Opts :: map() | encode_opts(), Return :: encode_result().

Equivalent to euneus_encoder:encode / 2.

Generates a JSON from Erlang term.

See also: euneus_encoder:encode/2.

-spec encode_html(Input) -> Return when Input :: encode_input(), Return :: encode_result().

Equivalent to euneus_smart_html_encoder:encode / 1.

Generates a JSON from Erlang term.

Uses HTML encoder.

See also: euneus_smart_html_encoder:encode/1.

Link to this function

encode_html_to_binary(Input)

View Source
-spec encode_html_to_binary(Input) -> Return
                         when Input :: encode_input(), Return :: encode_to_bin_result().

Generates a JSON as erlang:binary() from Erlang term.

Uses HTML encoder.

See also: euneus_smart_html_encoder:encode/1.

-spec encode_js(Input) -> Return when Input :: encode_input(), Return :: encode_result().

Equivalent to euneus_smart_js_encoder:encode / 1.

Generates a JSON from Erlang term.

Uses Javascript encoder.

See also: euneus_smart_js_encoder:encode/1.

Link to this function

encode_js_to_binary(Input)

View Source
-spec encode_js_to_binary(Input) -> Return
                       when Input :: encode_input(), Return :: encode_to_bin_result().

Generates a JSON as erlang:binary() from Erlang term.

Uses Javascript encoder.

See also: euneus_smart_js_encoder:encode/1.

Link to this function

encode_parsed(Input, ParsedOpts)

View Source
-spec encode_parsed(Input, ParsedOpts) -> Result
                 when
                     Input :: encode_input(),
                     ParsedOpts :: encode_opts(),
                     Result :: encode_result().

Equivalent to euneus_encoder:encode_parsed / 2.

Generates a JSON from Erlang term.

See also: euneus_encoder:encode_parsed/2.

Link to this function

encode_parsed_to_binary(Input, ParsedOpts)

View Source
-spec encode_parsed_to_binary(Input, ParsedOpts) -> Result
                           when
                               Input :: encode_input(),
                               ParsedOpts :: encode_opts(),
                               Result :: encode_to_bin_result().
Generates a JSON as erlang:binary() from Erlang term.

See also: euneus_encoder:encode_parsed/2.

-spec encode_to_binary(Input) -> Return when Input :: encode_input(), Return :: encode_to_bin_result().

Generates a JSON as erlang:binary() from Erlang term.

Uses JSON encoder.

See also: euneus_smart_json_encoder:encode/1.

Link to this function

encode_to_binary(Input, Opts)

View Source
-spec encode_to_binary(Input, Opts) -> Return
                    when
                        Input :: encode_input(),
                        Opts :: map() | encode_opts(),
                        Return :: encode_to_bin_result().
Generates a JSON as erlang:binary() from Erlang term.

See also: euneus_encoder:encode/2.

-spec encode_unicode(Input) -> Return when Input :: encode_input(), Return :: encode_result().

Equivalent to euneus_smart_unicode_encoder:encode / 1.

Generates a JSON from Erlang term.

Uses Unicode encoder.

See also: euneus_smart_unicode_encoder:encode/1.

Link to this function

encode_unicode_to_binary(Input)

View Source
-spec encode_unicode_to_binary(Input) -> Return
                            when Input :: encode_input(), Return :: encode_to_bin_result().

Generates a JSON as erlang:binary() from Erlang term.

Uses Unicode encoder.

See also: euneus_smart_unicode_encoder:encode/1.

-spec parse_decode_opts(Opts) -> Result when Opts :: map(), Result :: decode_opts().

Equivalent to euneus_decoder:parse_opts / 1.

Parses erlang:map() to euneus_decoder:options().

See also: euneus_decoder:decode_parsed/2, euneus_decoder:parse_opts/1.

-spec parse_encode_opts(Opts) -> Result when Opts :: map(), Result :: encode_opts().

Equivalent to euneus_encoder:parse_opts / 1.

Parses erlang:map() to euneus_encoder:options().

See also: euneus_encoder:encode_parsed/2, euneus_encoder:parse_opts/1.