Set up mix_gleam archive, gleam_stdlib, and gleeunit deps. Add Gleam compiler to all Dockerfiles, CI workflows, nix shell, and .tool-versions. Rewrite Numeric, QueryHelpers, and URLValidator from Elixir to Gleam with full ExUnit test coverage. Update all callers to use the Gleam modules directly via :towerops@module syntax. Remove duplicate sanitize_like/1 private functions in snmp.ex and trace.ex. Reviewed-on: graham/towerops-web#98
14 lines
320 B
Erlang
14 lines
320 B
Erlang
-module(towerops_numeric_ffi).
|
|
-export([parse_integer/1, parse_float/1]).
|
|
|
|
parse_integer(S) ->
|
|
case 'Elixir.Integer':parse(S) of
|
|
{I, _} -> {ok, I};
|
|
error -> {error, nil}
|
|
end.
|
|
|
|
parse_float(S) ->
|
|
case 'Elixir.Float':parse(S) of
|
|
{F, _} -> {ok, F};
|
|
error -> {error, nil}
|
|
end.
|