Add route age information to IP lookup API
- Add last_updated timestamp and age fields to ASInfo - Include route's last_updated time from live_routes table - Calculate and display age as human-readable duration - Update both IPv4 and IPv6 queries to fetch timestamp - Fix error handling to return 400 for invalid IPs
This commit is contained in:
@@ -70,8 +70,10 @@ type PrefixDistribution struct {
|
||||
|
||||
// ASInfo represents AS information for an IP lookup
|
||||
type ASInfo struct {
|
||||
ASN int `json:"asn"`
|
||||
Handle string `json:"handle"`
|
||||
Description string `json:"description"`
|
||||
Prefix string `json:"prefix"`
|
||||
ASN int `json:"asn"`
|
||||
Handle string `json:"handle"`
|
||||
Description string `json:"description"`
|
||||
Prefix string `json:"prefix"`
|
||||
LastUpdated time.Time `json:"last_updated"`
|
||||
Age string `json:"age"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user