(EnvSettings env)
| 30 | private readonly Dictionary<string, Dictionary<string, Coordinates>> _coordinates; |
| 31 | |
| 32 | public GeoIPClient(EnvSettings env) |
| 33 | { |
| 34 | var text = File.ReadAllText(Path.Combine(env.EtcDirectoryPath, "geoip/coordinates.json")); |
| 35 | var coordinates = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, Coordinates>>>(text); |
| 36 | if (coordinates == null) |
| 37 | throw new Exception("Failed to deserialize coordinates.json"); |
| 38 | |
| 39 | _coordinates = coordinates; |
| 40 | } |
| 41 | |
| 42 | public (double, double) GetLatLng(string countryCode, string regionName) |
| 43 | { |
nothing calls this directly
no outgoing calls
no test coverage detected