as

package
v0.0.0-...-933fec0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BGPVIEW_API_URL = "https://api.bgpview.io"
	ASRANK_API_URL  = "https://api.asrank.caida.org/v2/restful"
)

Variables

This section is empty.

Functions

func GenerateDBDetails

func GenerateDBDetails()

func GenerateDBOverview

func GenerateDBOverview()

func ReverseDns

func ReverseDns(ip string) []string

Types

type AsRankEntry

type AsRankEntry struct {
	Data struct {
		Asns struct {
			TotalCount int `json:"totalCount"`
			PageInfo   struct {
				HasNextPage bool `json:"hasNextPage"`
			} `json:"pageInfo"`
			Edges []struct {
				Node struct {
					Rank         int         `json:"rank"`
					Asn          string      `json:"asn"`
					AsnName      string      `json:"asnName"`
					Source       string      `json:"source"`
					Seen         bool        `json:"seen"`
					Ixp          interface{} `json:"ixp"`
					Longitude    float64     `json:"longitude"`
					Latitude     float64     `json:"latitude"`
					Organization struct {
						OrgID string `json:"orgId"`
					} `json:"organization"`
					Cone struct {
						NumberAsns      int `json:"numberAsns"`
						NumberPrefixes  int `json:"numberPrefixes"`
						NumberAddresses int `json:"numberAddresses"`
					} `json:"cone"`
					Country struct {
						Iso string `json:"iso"`
					} `json:"country"`
					AsnDegree struct {
						Total    int `json:"total"`
						Customer int `json:"customer"`
						Peer     int `json:"peer"`
						Provider int `json:"provider"`
					} `json:"asnDegree"`
				} `json:"node"`
			} `json:"edges"`
		} `json:"asns"`
	} `json:"data"`
}

type AsnPeers

type AsnPeers struct {
	Status        string `json:"status"`
	StatusMessage string `json:"status_message"`
	Data          struct {
		Ipv4Peers []struct {
			Asn         int         `json:"asn"`
			Name        interface{} `json:"name"` // seems to be always null
			Description string      `json:"description"`
			CountryCode string      `json:"country_code"`
		} `json:"ipv4_peers"`
		Ipv6Peers []struct {
			Asn         int         `json:"asn"`
			Name        interface{} `json:"name"`
			Description string      `json:"description"`
			CountryCode string      `json:"country_code"`
		} `json:"ipv6_peers"`
	} `json:"data"`
}

type AsnPrefixes

type AsnPrefixes struct {
	Status        string `json:"status"`
	StatusMessage string `json:"status_message"`
	Data          struct {
		Ipv4Prefixes []struct {
			// Prefix string `json:"prefix"`
			IP          string `json:"ip"`
			Cidr        int    `json:"cidr"`
			Name        string `json:"name"`
			Description string `json:"description"`
			CountryCode string `json:"country_code"`
			Parent      struct {
				Prefix string `json:"prefix"`
				IP     string `json:"ip"`
				Cidr   int    `json:"cidr"`
			} `json:"parent"`
		} `json:"ipv4_prefixes"`
		Ipv6Prefixes []struct {
			// Prefix string `json:"prefix"`
			IP          string `json:"ip"`
			Cidr        int    `json:"cidr"`
			Name        string `json:"name"`
			Description string `json:"description"`
			CountryCode string `json:"country_code"`
			Parent      struct {
				Prefix string `json:"prefix"`
				IP     string `json:"ip"`
				Cidr   int    `json:"cidr"`
			} `json:"parent"`
		} `json:"ipv6_prefixes"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL