MCPcopy Create free account
hub / github.com/aptabase/aptabase / GeoIPClient

Method GeoIPClient

src/Features/GeoIP/IGeoIPClient.cs:32–40  ·  view source on GitHub ↗
(EnvSettings env)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected