Store location information in peer event meta (#1994)

This commit is contained in:
Maycon Santos 2024-05-22 12:31:16 +02:00 committed by GitHub
parent 61034aaf4d
commit 91fa2e20a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -216,7 +216,9 @@ func (p *Peer) FQDN(dnsDomain string) string {
// EventMeta returns activity event meta related to the peer // EventMeta returns activity event meta related to the peer
func (p *Peer) EventMeta(dnsDomain string) map[string]any { func (p *Peer) EventMeta(dnsDomain string) map[string]any {
return map[string]any{"name": p.Name, "fqdn": p.FQDN(dnsDomain), "ip": p.IP, "created_at": p.CreatedAt} return map[string]any{"name": p.Name, "fqdn": p.FQDN(dnsDomain), "ip": p.IP, "created_at": p.CreatedAt,
"location_city_name": p.Location.CityName, "location_country_code": p.Location.CountryCode,
"location_geo_name_id": p.Location.GeoNameID, "location_connection_ip": p.Location.ConnectionIP}
} }
// Copy PeerStatus // Copy PeerStatus