- Created bgp_peers table to track all BGP peers - Added PeerHandler to update peer last seen times for all message types - Removed verbose BGP keepalive debug logging - BGP keepalive messages now silently update peer tracking Refactor HTML templates to use go:embed - Created internal/templates package with embedded templates - Moved status.html from inline const to separate file - Templates are parsed once on startup - Server now uses parsed template instead of raw string Optimize AS data embedding with gzip compression - Changed asinfo package to embed gzipped data (2.4MB vs 12MB) - Updated Makefile to gzip AS data during update - Added decompression during initialization - Raw JSON file excluded from git
29 lines
840 B
Go
29 lines
840 B
Go
/*
|
|
Package asinfo provides information about Autonomous Systems (AS).
|
|
|
|
The package embeds a comprehensive database of AS numbers, handles, and descriptions
|
|
sourced from https://github.com/ipverse/asn-info. The data is embedded at compile
|
|
time and provides fast, offline lookups.
|
|
|
|
Basic usage:
|
|
|
|
// Get information about an AS
|
|
info, ok := asinfo.Get(15169)
|
|
if ok {
|
|
fmt.Printf("AS%d: %s - %s\n", info.ASN, info.Handle, info.Description)
|
|
}
|
|
|
|
// Get just the description
|
|
desc := asinfo.GetDescription(15169) // "Google LLC"
|
|
|
|
// Search for AS entries
|
|
results := asinfo.Search("University")
|
|
for _, as := range results {
|
|
fmt.Printf("AS%d: %s\n", as.ASN, as.Description)
|
|
}
|
|
|
|
The data is loaded lazily on first access and cached in memory for the lifetime
|
|
of the program. All getter methods are safe for concurrent use.
|
|
*/
|
|
package asinfo
|