Skip to content

Draft: pkg/api/api.go, pkg/api/gateway.go - add endpoint 5/gateways/bydistance/{cc}, func GatewaysByDistance

sgk requested to merge feat/gatewaysbydistance into main

pkg/api/api.go - add endpoint 5/gateways/bydistance/{cc},

pkg/api/gateway.go - func GatewaysByDistance

sample request and response :

$ curl localhost:8443/api/5/gateways/bydistance/FR
[{"Location":{"country_code":"FR","display_name":"Paris","has_bridges":true,"healthy":true,"hemisphere":"N","label":"paris","lat":"48.85","lon":"2.35","region":"","timezone":"+2"},"Distance":2.625899235318258},{"Location":{"country_code":"NL","display_name":"Amsterdam","has_bridges":true,"healthy":true,"hemisphere":"N","label":"amsterdam","lat":"52.37","lon":"4.90","region":"","timezone":"+2"},"Distance":6.704070060347295},{"Location":{"country_code":"CA","display_name":"Montreal","has_bridges":true,"healthy":true,"hemisphere":"N","label":"montreal","lat":"45.52","lon":"-73.65","region":"","timezone":"-4"},"Distance":75.86704926299721},{"Location":{"country_code":"US","display_name":"New York","has_bridges":true,"healthy":true,"hemisphere":"N","label":"newyorkcity","lat":"40.71","lon":"-74.01","region":"","timezone":"-4"},"Distance":76.42319177261602},{"Location":{"country_code":"US","display_name":"Miami","has_bridges":true,"healthy":true,"hemisphere":"S","label":"miami","lat":"25.77","lon":"-80.19","region":"","timezone":"-4"},"Distance":84.90519890910124},{"Location":{"country_code":"US","display_name":"Seattle","has_bridges":true,"healthy":true,"hemisphere":"N","label":"seattle","lat":"47.61","lon":"-122.33","region":"","timezone":"-7"},"Distance":124.55142046429677}]

Merge request reports