Current section
Files
Jump to
Current section
Files
src/illustrious@internal@api_helpers.erl
-module(illustrious@internal@api_helpers).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([get_root/0, get_illustrious_api/0, get_baked_data/0]).
-spec get_root() -> binary().
get_root() ->
<<"http://localhost:1234"/utf8>>.
-spec get_illustrious_api() -> binary().
get_illustrious_api() ->
<<(get_root())/binary, "/illustrious_api"/utf8>>.
-spec get_baked_data_internal() -> binary().
get_baked_data_internal() ->
<<"null"/utf8>>.
-spec get_baked_data() -> {ok, binary()} | {error, binary()}.
get_baked_data() ->
case get_baked_data_internal() of
<<"null"/utf8>> ->
{error, <<"No baked data found"/utf8>>};
Data ->
{ok, Data}
end.