Add /api/v1/ip/<ip> endpoint for IP to AS lookups
- Add handleIPLookup handler that uses GetASInfoForIP - Create writeJSONError and writeJSONSuccess helper functions - Refactor all JSON error responses to use the helpers - Add GetASInfoForIP to Store interface - Add mock implementation for tests - Fix all linter warnings
This commit is contained in:
@@ -44,6 +44,9 @@ type Store interface {
|
||||
GetPrefixDistribution() (ipv4 []PrefixDistribution, ipv6 []PrefixDistribution, err error)
|
||||
GetLiveRouteCounts() (ipv4Count, ipv6Count int, err error)
|
||||
|
||||
// IP lookup operations
|
||||
GetASInfoForIP(ip string) (*ASInfo, error)
|
||||
|
||||
// Lifecycle
|
||||
Close() error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user