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:
7
Makefile
7
Makefile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user