package database import ( "time" "github.com/google/uuid" ) // Stats contains database statistics type Stats struct { ASNs int Prefixes int IPv4Prefixes int IPv6Prefixes int Peerings int LiveRoutes int } // Store defines the interface for database operations type Store interface { // ASN operations GetOrCreateASN(number int, timestamp time.Time) (*ASN, error) // Prefix operations GetOrCreatePrefix(prefix string, timestamp time.Time) (*Prefix, error) // Announcement operations RecordAnnouncement(announcement *Announcement) error // Peering operations RecordPeering(fromASNID, toASNID string, timestamp time.Time) error // Live route operations UpdateLiveRoute(prefixID, originASNID uuid.UUID, peerASN int, nextHop string, timestamp time.Time) error WithdrawLiveRoute(prefixID uuid.UUID, peerASN int, timestamp time.Time) error GetActiveLiveRoutes() ([]LiveRoute, error) // Statistics GetStats() (Stats, error) // Lifecycle Close() error } // Ensure Database implements Store var _ Store = (*Database)(nil)