(ip net.IP)
| 27 | } |
| 28 | |
| 29 | func (o *Geo) GetGeo(ip net.IP) string { |
| 30 | if o.geoReader == nil { |
| 31 | return "N/A" |
| 32 | } |
| 33 | o.mu.Lock() |
| 34 | defer o.mu.Unlock() |
| 35 | country, err := o.geoReader.Country(ip) |
| 36 | if err != nil { |
| 37 | slog.Debug("Error reading geo", "err", err) |
| 38 | return "N/A" |
| 39 | } |
| 40 | return country.Country.IsoCode |
| 41 | } |