package database import ( "time" "github.com/google/uuid" ) // ASN represents an Autonomous System Number type ASN struct { ID uuid.UUID `json:"id"` Number int `json:"number"` FirstSeen time.Time `json:"first_seen"` LastSeen time.Time `json:"last_seen"` } // Prefix represents an IP prefix (CIDR block) type Prefix struct { ID uuid.UUID `json:"id"` Prefix string `json:"prefix"` IPVersion int `json:"ip_version"` // 4 or 6 FirstSeen time.Time `json:"first_seen"` LastSeen time.Time `json:"last_seen"` } // Announcement represents a BGP announcement type Announcement struct { ID uuid.UUID `json:"id"` PrefixID uuid.UUID `json:"prefix_id"` ASNID uuid.UUID `json:"asn_id"` OriginASNID uuid.UUID `json:"origin_asn_id"` Path string `json:"path"` // JSON-encoded AS path NextHop string `json:"next_hop"` Timestamp time.Time `json:"timestamp"` IsWithdrawal bool `json:"is_withdrawal"` } // ASNPeering represents a peering relationship between two ASNs type ASNPeering struct { ID uuid.UUID `json:"id"` FromASNID uuid.UUID `json:"from_asn_id"` ToASNID uuid.UUID `json:"to_asn_id"` FirstSeen time.Time `json:"first_seen"` LastSeen time.Time `json:"last_seen"` } // LiveRoute represents the current state of a route in the live routing table type LiveRoute struct { ID uuid.UUID `json:"id"` PrefixID uuid.UUID `json:"prefix_id"` OriginASNID uuid.UUID `json:"origin_asn_id"` PeerASN int `json:"peer_asn"` Path string `json:"path"` NextHop string `json:"next_hop"` AnnouncedAt time.Time `json:"announced_at"` WithdrawnAt *time.Time `json:"withdrawn_at"` }