grids2 #11

Merged
zxq9 merged 3 commits from grids2 into master 2025-12-22 10:04:39 +09:00
Showing only changes of commit f5e955b583 - Show all commits

View File

@ -88,7 +88,7 @@ url(Instruction, Recipient, Amount) ->
Node :: {inet:ip_address() | inet:hostname(), inet:port_number()} Node :: {inet:ip_address() | inet:hostname(), inet:port_number()}
| uri_string:uri_string(), % "http://..." | "https://..." | uri_string:uri_string(), % "http://..." | "https://..."
Recipient :: string(), Recipient :: string(),
Amount :: non_neg_integer(), Amount :: non_neg_integer() | none,
Payload :: binary(), Payload :: binary(),
GRIDS :: uri_string:uri_string(). GRIDS :: uri_string:uri_string().
%% @doc %% @doc
@ -113,8 +113,12 @@ h_to_s(Host) when is_binary(Host) -> Host;
h_to_s(Host) when is_tuple(Host) -> inet:ntoa(Host); h_to_s(Host) when is_tuple(Host) -> inet:ntoa(Host);
h_to_s(Host) when is_atom(Host) -> atom_to_list(Host). h_to_s(Host) when is_atom(Host) -> atom_to_list(Host).
qwargs(none, "") ->
[];
qwargs(Amount, "") -> qwargs(Amount, "") ->
["?a=", integer_to_list(Amount)]; ["?a=", integer_to_list(Amount)];
qwargs(none, Payload) ->
[$? | uri_string:compose_query([{"p", Payload}])];
qwargs(Amount, Payload) -> qwargs(Amount, Payload) ->
[$? | uri_string:compose_query([{"a", integer_to_list(Amount)}, {"p", Payload}])]. [$? | uri_string:compose_query([{"a", integer_to_list(Amount)}, {"p", Payload}])].