Simplify peerings table to store AS numbers directly
- Rename asn_peerings table to peerings - Change columns from from_asn_id/to_asn_id to as_a/as_b (integers) - Remove foreign key constraints to asns table - Update RecordPeering to use AS numbers directly - Add validation in RecordPeering to ensure: - Both AS numbers are > 0 - AS numbers are different - as_a is always lower than as_b (normalized) - Update PeeringHandler to no longer need ASN cache - Simplify the code by removing unnecessary ASN lookups
This commit is contained in:
@@ -29,7 +29,7 @@ type Store interface {
|
||||
RecordAnnouncement(announcement *Announcement) error
|
||||
|
||||
// Peering operations
|
||||
RecordPeering(fromASNID, toASNID string, timestamp time.Time) error
|
||||
RecordPeering(asA, asB int, timestamp time.Time) error
|
||||
|
||||
// Statistics
|
||||
GetStats() (Stats, error)
|
||||
|
||||
Reference in New Issue
Block a user