Add asinfo package for AS number information lookups

- Created pkg/asinfo with embedded AS data from ipverse/asn-info
- Provides fast lookups by ASN with GetDescription() and GetHandle()
- Includes Search() functionality for finding AS by name/handle
- Added asinfo-gen tool to fetch and convert CSV data to JSON
- Added 'make asupdate' target to refresh AS data
- Embedded JSON data contains 130k+ AS entries
- Added comprehensive tests and examples
This commit is contained in:
2025-07-27 21:41:02 +02:00
parent 14e85f042b
commit ee80311ba1
8 changed files with 652498 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
export DEBUG = routewatch
.PHONY: test fmt lint build clean run
.PHONY: test fmt lint build clean run asupdate
all: test
@@ -22,3 +22,8 @@ clean:
run: build
./bin/routewatch
asupdate:
@echo "Updating AS info data..."
@go run cmd/asinfo-gen/main.go > pkg/asinfo/asdata.json.tmp && \
mv pkg/asinfo/asdata.json.tmp pkg/asinfo/asdata.json