gatus/core
Heitor 744d63abac
fix: Support hexadecimal integers in conditions (#563)
* Fix parsing hexadecimal integers in conditions

Remove the assumption that JSON contains only decimal integers and
instead identify the base from the prefix of the data.

`strconv.ParseInt` can identify the base of the integer based on its
"prefix":
- 0x -> hexadecimal
- 0o -> octal
- 0b -> binary
- decimal otherwise.

* core: add more tests for condiction.evaluate

* fix isEqual parsing integers as strings

* tests: extend conditions

* Test if we can compare equality of hex in JSON

* Test if we can have hex/oct/bin in conditions

---------

Co-authored-by: TwiN <twin@linux.com>
2023-10-04 20:25:18 -04:00
..
ui refactor(badge): Fix formatting 2022-08-10 21:09:22 -04:00
condition_bench_test.go fix: Print response body on failure if debug is set to true 2023-03-14 20:02:31 -04:00
condition_result.go Replace - by _ in file names 2021-07-02 20:04:05 -04:00
condition_test.go fix: Support hexadecimal integers in conditions (#563) 2023-10-04 20:25:18 -04:00
condition.go fix: Support hexadecimal integers in conditions (#563) 2023-10-04 20:25:18 -04:00
dns_test.go fix: Print response body on failure if debug is set to true 2023-03-14 20:02:31 -04:00
dns.go fix: Print response body on failure if debug is set to true 2023-03-14 20:02:31 -04:00
endpoint_status_test.go Rename Service to Endpoint (#192) 2021-10-23 16:47:12 -04:00
endpoint_status.go chore: Bump module version to v5 2022-12-06 01:41:18 -05:00
endpoint_test.go feat(SSH): Add support for SSH endpoint (#473) 2023-09-23 13:37:24 -04:00
endpoint.go refactor: Clean up code and improve test coverage 2023-09-28 18:35:18 -04:00
event_test.go Add test for NewEventFromResult 2021-09-06 16:34:03 -04:00
event.go Rename Service to Endpoint (#192) 2021-10-23 16:47:12 -04:00
result_test.go Fix #123: Deduplicate result errors 2021-06-05 18:50:24 -04:00
result.go fix: Print response body on failure if debug is set to true 2023-03-14 20:02:31 -04:00
uptime.go Remove old memory uptime implementation and auto migration 2021-09-06 13:28:35 -04:00