Documentation
¶
Overview ¶
Package peeringdb provides structures and functions to interact with the PeeringDB API. The API documentation is available here: https://www.peeringdb.com/apidocs/
The PeeringDB API is based on REST principles and returns data formatted in JSON. This package queries the API with the correct URL and parameters, parses the JSON response, and converts it into Go structures. Currently, this package only supports GET requests and cannot be used to modify any PeeringDB records.
All calls to the PeeringDB API use the "depth=1" parameter. This means that sets are expanded as integer slices instead of slices of structures, which speeds up the API processing time. To get the structures for a given set, you just need to iterate over the set and call the appropriate function to retrieve structures from IDs.
Example ¶
api := NewAPI()
ctx := context.Background()
// Look for the organization given a name
search := url.Values{}
search.Set("name", "Guillaume Mazoyer")
// Get the organization
organizations, err := api.GetOrganization(ctx, search)
if err != nil {
fmt.Println(err)
return
}
if len(organizations) < 1 {
fmt.Printf("No organization found with name '%s'\n", search.Get("name"))
return
}
if len(organizations) > 1 {
fmt.Printf("More than one organizations found with name '%s'\n",
search.Get("name"))
return
}
org := organizations[0]
// Find if there are networks linked to the organization
for _, networkID := range org.NetworkSet {
network, err := api.GetNetworkByID(ctx, networkID)
if err != nil {
fmt.Println(err)
} else {
fmt.Print(network.Name)
}
}
Index ¶
- Constants
- Variables
- type API
- func (api *API) GetASN(ctx context.Context, asn int) (*Network, error)
- func (api *API) GetAllCampuses(ctx context.Context) ([]Campus, error)
- func (api *API) GetAllCarrierFacilities(ctx context.Context) ([]CarrierFacility, error)
- func (api *API) GetAllCarriers(ctx context.Context) ([]Carrier, error)
- func (api *API) GetAllFacilities(ctx context.Context) ([]Facility, error)
- func (api *API) GetAllInternetExchangeFacilities(ctx context.Context) ([]InternetExchangeFacility, error)
- func (api *API) GetAllInternetExchangeLANs(ctx context.Context) ([]InternetExchangeLAN, error)
- func (api *API) GetAllInternetExchangePrefixes(ctx context.Context) ([]InternetExchangePrefix, error)
- func (api *API) GetAllInternetExchanges(ctx context.Context) ([]InternetExchange, error)
- func (api *API) GetAllNetworkContacts(ctx context.Context) ([]NetworkContact, error)
- func (api *API) GetAllNetworkFacilities(ctx context.Context) ([]NetworkFacility, error)
- func (api *API) GetAllNetworkInternetExchangeLANs(ctx context.Context) ([]NetworkInternetExchangeLAN, error)
- func (api *API) GetAllNetworks(ctx context.Context) ([]Network, error)
- func (api *API) GetAllOrganizations(ctx context.Context) ([]Organization, error)
- func (api *API) GetCampus(ctx context.Context, search url.Values) ([]Campus, error)
- func (api *API) GetCampusByID(ctx context.Context, id int) (*Campus, error)
- func (api *API) GetCarrier(ctx context.Context, search url.Values) ([]Carrier, error)
- func (api *API) GetCarrierByID(ctx context.Context, id int) (*Carrier, error)
- func (api *API) GetCarrierFacility(ctx context.Context, search url.Values) ([]CarrierFacility, error)
- func (api *API) GetCarrierFacilityByID(ctx context.Context, id int) (*CarrierFacility, error)
- func (api *API) GetFacility(ctx context.Context, search url.Values) ([]Facility, error)
- func (api *API) GetFacilityByID(ctx context.Context, id int) (*Facility, error)
- func (api *API) GetInternetExchange(ctx context.Context, search url.Values) ([]InternetExchange, error)
- func (api *API) GetInternetExchangeByID(ctx context.Context, id int) (*InternetExchange, error)
- func (api *API) GetInternetExchangeFacility(ctx context.Context, search url.Values) ([]InternetExchangeFacility, error)
- func (api *API) GetInternetExchangeFacilityByID(ctx context.Context, id int) (*InternetExchangeFacility, error)
- func (api *API) GetInternetExchangeLAN(ctx context.Context, search url.Values) ([]InternetExchangeLAN, error)
- func (api *API) GetInternetExchangeLANByID(ctx context.Context, id int) (*InternetExchangeLAN, error)
- func (api *API) GetInternetExchangePrefix(ctx context.Context, search url.Values) ([]InternetExchangePrefix, error)
- func (api *API) GetInternetExchangePrefixByID(ctx context.Context, id int) (*InternetExchangePrefix, error)
- func (api *API) GetNetwork(ctx context.Context, search url.Values) ([]Network, error)
- func (api *API) GetNetworkByID(ctx context.Context, id int) (*Network, error)
- func (api *API) GetNetworkContact(ctx context.Context, search url.Values) ([]NetworkContact, error)
- func (api *API) GetNetworkContactByID(ctx context.Context, id int) (*NetworkContact, error)
- func (api *API) GetNetworkFacility(ctx context.Context, search url.Values) ([]NetworkFacility, error)
- func (api *API) GetNetworkFacilityByID(ctx context.Context, id int) (*NetworkFacility, error)
- func (api *API) GetNetworkInternetExchangeLAN(ctx context.Context, search url.Values) ([]NetworkInternetExchangeLAN, error)
- func (api *API) GetNetworkInternetExchangeLANByID(ctx context.Context, id int) (*NetworkInternetExchangeLAN, error)
- func (api *API) GetOrganization(ctx context.Context, search url.Values) ([]Organization, error)
- func (api *API) GetOrganizationByID(ctx context.Context, id int) (*Organization, error)
- type Campus
- type Carrier
- type CarrierFacility
- type Facility
- type InternetExchange
- type InternetExchangeFacility
- type InternetExchangeLAN
- type InternetExchangePrefix
- type Network
- type NetworkContact
- type NetworkFacility
- type NetworkInternetExchangeLAN
- type Option
- type Organization
- type SocialMedia
Examples ¶
Constants ¶
const Version = "0.1.0"
Variables ¶
var ( // ErrBuildingRequest is returned if the HTTP request to call the API // cannot be built as expected. ErrBuildingRequest = errors.New("error building request for peeringdb api") // ErrQueryingAPI is returned if there is an issue while making the // request to the API. ErrQueryingAPI = errors.New("error querying peeringdb api") // ErrRateLimitExceeded is returned if the API rate limit is exceeded. ErrRateLimitExceeded = errors.New("rate limit exceeded") // ErrInvalidID is returned when a resource ID is invalid (e.g. <= 0). ErrInvalidID = errors.New("invalid resource ID") )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is the structure used to interact with the PeeringDB API.
func (*API) GetASN ¶
GetASN returns the Network matching the given AS number. If the AS number cannot be found, an error is returned.
Example ¶
api := NewAPI()
as201281, err := api.GetASN(context.Background(), 201281)
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Printf("Name: %s\n", as201281.Name)
fmt.Printf("ASN: %d\n", as201281.ASN)
func (*API) GetAllCampuses ¶
GetAllCampuses returns all Campus structures available from the API.
func (*API) GetAllCarrierFacilities ¶
func (api *API) GetAllCarrierFacilities(ctx context.Context) ([]CarrierFacility, error)
GetAllCarrierFacilities returns all CarrierFacility structures available from the API.
func (*API) GetAllCarriers ¶
GetAllCarriers returns all Carrier structures available from the API.
func (*API) GetAllFacilities ¶
GetAllFacilities returns all Facility structures available from the API.
func (*API) GetAllInternetExchangeFacilities ¶
func (api *API) GetAllInternetExchangeFacilities(ctx context.Context) ([]InternetExchangeFacility, error)
GetAllInternetExchangeFacilities returns all InternetExchangeFacility structures available from the API.
func (*API) GetAllInternetExchangeLANs ¶
func (api *API) GetAllInternetExchangeLANs(ctx context.Context) ([]InternetExchangeLAN, error)
GetAllInternetExchangeLANs returns all InternetExchangeLAN structures available from the API.
func (*API) GetAllInternetExchangePrefixes ¶
func (api *API) GetAllInternetExchangePrefixes(ctx context.Context) ([]InternetExchangePrefix, error)
GetAllInternetExchangePrefixes returns all InternetExchangePrefix structures available from the API.
func (*API) GetAllInternetExchanges ¶
func (api *API) GetAllInternetExchanges(ctx context.Context) ([]InternetExchange, error)
GetAllInternetExchanges returns all InternetExchange structures available from the API.
func (*API) GetAllNetworkContacts ¶
func (api *API) GetAllNetworkContacts(ctx context.Context) ([]NetworkContact, error)
GetAllNetworkContacts returns all NetworkContact structures available from the API.
func (*API) GetAllNetworkFacilities ¶
func (api *API) GetAllNetworkFacilities(ctx context.Context) ([]NetworkFacility, error)
GetAllNetworkFacilities returns all NetworkFacility structures available from the API.
func (*API) GetAllNetworkInternetExchangeLANs ¶
func (api *API) GetAllNetworkInternetExchangeLANs(ctx context.Context) ([]NetworkInternetExchangeLAN, error)
GetAllNetworkInternetExchangeLANs returns all NetworkInternetExchangeLAN structures available from the API.
func (*API) GetAllNetworks ¶
GetAllNetworks returns all Network structures available from the API.
func (*API) GetAllOrganizations ¶
func (api *API) GetAllOrganizations(ctx context.Context) ([]Organization, error)
GetAllOrganizations returns all Organization structures available from the API.
func (*API) GetCampus ¶
GetCampus returns a slice of Campus structures matching the given search parameters.
func (*API) GetCampusByID ¶
GetCampusByID returns the Campus matching the given ID, or nil if not found.
func (*API) GetCarrier ¶
GetCarrier returns a slice of Carrier structures matching the given search parameters.
func (*API) GetCarrierByID ¶
GetCarrierByID returns the Carrier matching the given ID, or nil if not found.
func (*API) GetCarrierFacility ¶
func (api *API) GetCarrierFacility(ctx context.Context, search url.Values) ([]CarrierFacility, error)
GetCarrierFacility returns a slice of CarrierFacility structures matching the given search parameters.
func (*API) GetCarrierFacilityByID ¶
GetCarrierFacilityByID returns the CarrierFacility matching the given ID, or nil if not found.
func (*API) GetFacility ¶
GetFacility returns a slice of Facility structures matching the given search parameters.
func (*API) GetFacilityByID ¶
GetFacilityByID returns the Facility matching the given ID, or nil if not found.
func (*API) GetInternetExchange ¶
func (api *API) GetInternetExchange(ctx context.Context, search url.Values) ([]InternetExchange, error)
GetInternetExchange returns a slice of InternetExchange structures matching the given search parameters.
func (*API) GetInternetExchangeByID ¶
GetInternetExchangeByID returns the InternetExchange matching the given ID, or nil if not found.
func (*API) GetInternetExchangeFacility ¶
func (api *API) GetInternetExchangeFacility(ctx context.Context, search url.Values) ([]InternetExchangeFacility, error)
GetInternetExchangeFacility returns a slice of InternetExchangeFacility structures matching the given search parameters.
func (*API) GetInternetExchangeFacilityByID ¶
func (api *API) GetInternetExchangeFacilityByID(ctx context.Context, id int) (*InternetExchangeFacility, error)
GetInternetExchangeFacilityByID returns the InternetExchangeFacility matching the given ID, or nil if not found.
func (*API) GetInternetExchangeLAN ¶
func (api *API) GetInternetExchangeLAN(ctx context.Context, search url.Values) ([]InternetExchangeLAN, error)
GetInternetExchangeLAN returns a slice of InternetExchangeLAN structures matching the given search parameters.
func (*API) GetInternetExchangeLANByID ¶
func (api *API) GetInternetExchangeLANByID(ctx context.Context, id int) (*InternetExchangeLAN, error)
GetInternetExchangeLANByID returns the InternetExchangeLAN matching the given ID, or nil if not found.
func (*API) GetInternetExchangePrefix ¶
func (api *API) GetInternetExchangePrefix(ctx context.Context, search url.Values) ([]InternetExchangePrefix, error)
GetInternetExchangePrefix returns a slice of InternetExchangePrefix structures matching the given search parameters.
func (*API) GetInternetExchangePrefixByID ¶
func (api *API) GetInternetExchangePrefixByID(ctx context.Context, id int) (*InternetExchangePrefix, error)
GetInternetExchangePrefixByID returns the InternetExchangePrefix matching the given ID, or nil if not found.
func (*API) GetNetwork ¶
GetNetwork returns a slice of Network structures matching the given search parameters.
func (*API) GetNetworkByID ¶
GetNetworkByID returns the Network matching the given ID, or nil if not found.
func (*API) GetNetworkContact ¶
GetNetworkContact returns a slice of NetworkContact structures matching the given search parameters.
func (*API) GetNetworkContactByID ¶
GetNetworkContactByID returns the NetworkContact matching the given ID, or nil if not found.
func (*API) GetNetworkFacility ¶
func (api *API) GetNetworkFacility(ctx context.Context, search url.Values) ([]NetworkFacility, error)
GetNetworkFacility returns a slice of NetworkFacility structures matching the given search parameters.
func (*API) GetNetworkFacilityByID ¶
GetNetworkFacilityByID returns the NetworkFacility matching the given ID, or nil if not found.
func (*API) GetNetworkInternetExchangeLAN ¶
func (api *API) GetNetworkInternetExchangeLAN(ctx context.Context, search url.Values) ([]NetworkInternetExchangeLAN, error)
GetNetworkInternetExchangeLAN returns a slice of NetworkInternetExchangeLAN structures matching the given search parameters.
func (*API) GetNetworkInternetExchangeLANByID ¶
func (api *API) GetNetworkInternetExchangeLANByID(ctx context.Context, id int) (*NetworkInternetExchangeLAN, error)
GetNetworkInternetExchangeLANByID returns the NetworkInternetExchangeLAN matching the given ID, or nil if not found.
func (*API) GetOrganization ¶
GetOrganization returns a slice of Organization structures matching the given search parameters.
func (*API) GetOrganizationByID ¶
GetOrganizationByID returns the Organization matching the given ID, or nil if not found.
type Campus ¶
type Campus struct {
ID int `json:"id"`
OrganizationID int `json:"org_id"`
OrganizationName string `json:"org_name"`
Organization Organization `json:"organization,omitempty"`
Name string `json:"name"`
NameLong string `json:"name_long"`
AKA string `json:"aka"`
Website string `json:"website"`
Notes string `json:"notes"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
City string `json:"city"`
Country string `json:"country"`
State string `json:"state"`
Zipcode string `json:"zipcode"`
FacilitySet []int `json:"fac_set"`
SocialMedia []SocialMedia `json:"social_media"`
}
Campus is the representation of a site where facilities are.
type Carrier ¶
type Carrier struct {
ID int `json:"id"`
OrganizationID int `json:"org_id"`
OrganizationName string `json:"org_name"`
Organization Organization `json:"organization,omitempty"`
Name string `json:"name"`
AKA string `json:"aka"`
NameLong string `json:"name_long"`
Website string `json:"website"`
Notes string `json:"notes"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
SocialMedia []SocialMedia `json:"social_media"`
}
Carrier is the representation of a network able to provide transport from one facility to another.
type CarrierFacility ¶
type CarrierFacility struct {
ID int `json:"id"`
Name string `json:"name"`
CarrierID int `json:"carrier_id"`
Carrier Carrier `json:"carrier,omitempty"`
FacilityID int `json:"fac_id"`
Facility Facility `json:"fac,omitempty"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
}
CarrierFacility links a Carrier with a Facility, indicating in which facilities a carrier operates.
type Facility ¶
type Facility struct {
ID int `json:"id"`
OrganizationID int `json:"org_id"`
OrganizationName string `json:"org_name"`
Organization Organization `json:"organization,omitempty"`
CampusID int `json:"campus_id"`
Campus Campus `json:"campus,omitempty"`
Name string `json:"name"`
AKA string `json:"aka"`
NameLong string `json:"name_long"`
Website string `json:"website"`
CLLI string `json:"clli"`
Rencode string `json:"rencode"`
Npanxx string `json:"npanxx"`
Notes string `json:"notes"`
NetCount int `json:"net_count"`
IXCount int `json:"ix_count"`
CarrierCount int `json:"carrier_count"`
SalesEmail string `json:"sales_email"`
SalesPhone string `json:"sales_phone"`
TechEmail string `json:"tech_email"`
TechPhone string `json:"tech_phone"`
AvailableVoltageServices []string `json:"available_voltage_services"`
DiverseServingSubstations bool `json:"diverse_serving_substations"`
Property string `json:"property"`
RegionContinent string `json:"region_continent"`
StatusDashboard string `json:"status_dashboard"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
Address1 string `json:"address1"`
Address2 string `json:"address2"`
City string `json:"city"`
Country string `json:"country"`
State string `json:"state"`
Zipcode string `json:"zipcode"`
Floor string `json:"floor"`
Suite string `json:"suite"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
SocialMedia []SocialMedia `json:"social_media"`
}
Facility is the representation of a location where network operators and Internet exchange points are located. Most of the time you know a facility as a datacenter.
type InternetExchange ¶
type InternetExchange struct {
ID int `json:"id"`
OrganizationID int `json:"org_id"`
Organization Organization `json:"org,omitempty"`
Name string `json:"name"`
AKA string `json:"aka"`
NameLong string `json:"name_long"`
City string `json:"city"`
Country string `json:"country"`
RegionContinent string `json:"region_continent"`
Media string `json:"media"`
Notes string `json:"notes"`
ProtoUnicast bool `json:"proto_unicast"`
ProtoMulticast bool `json:"proto_multicast"`
ProtoIPv6 bool `json:"proto_ipv6"`
Website string `json:"website"`
URLStats string `json:"url_stats"`
TechEmail string `json:"tech_email"`
TechPhone string `json:"tech_phone"`
PolicyEmail string `json:"policy_email"`
PolicyPhone string `json:"policy_phone"`
SalesPhone string `json:"sales_phone"`
SalesEmail string `json:"sales_email"`
FacilitySet []int `json:"fac_set"`
InternetExchangeLANSet []int `json:"ixlan_set"`
NetworkCount int `json:"net_count"`
FacilityCount int `json:"fac_count"`
IxfNetCount int `json:"ixf_net_count"`
IxfLastImport time.Time `json:"ixf_last_import"`
IxfImportRequest time.Time `json:"ixf_import_request"`
IxfImportRequestStatus string `json:"ixf_import_request_status"`
ServiceLevel string `json:"service_level"`
Terms string `json:"terms"`
StatusDashboard string `json:"status_dashboard"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
SocialMedia []SocialMedia `json:"social_media"`
}
InternetExchange represents an Internet exchange point. It is directly linked to the Organization that manages the IX.
type InternetExchangeFacility ¶
type InternetExchangeFacility struct {
ID int `json:"id"`
Name string `json:"name"`
City string `json:"city"`
Country string `json:"country"`
InternetExchangeID int `json:"ix_id"`
InternetExchange InternetExchange `json:"ix,omitempty"`
FacilityID int `json:"fac_id"`
Facility Facility `json:"fac,omitempty"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
}
InternetExchangeFacility links an InternetExchange with a Facility, indicating where an IX can be found or what IXs are in a given facility.
type InternetExchangeLAN ¶
type InternetExchangeLAN struct {
ID int `json:"id"`
InternetExchangeID int `json:"ix_id"`
InternetExchange InternetExchange `json:"ix,omitempty"`
Name string `json:"name"`
Description string `json:"descr"`
MTU int `json:"mtu"`
Dot1QSupport bool `json:"dot1q_support"`
RouteServerASN int `json:"rs_asn"`
ARPSponge string `json:"arp_sponge"`
NetworkSet []int `json:"net_set"`
InternetExchangePrefixSet []int `json:"ixpfx_set"`
IXFIXPMemberListURL string `json:"ixf_ixp_member_list_url"`
IXFIXPMemberListURLVisible string `json:"ixf_ixp_member_list_url_visible"`
IXFIXPImportEnabled bool `json:"ixf_ixp_import_enabled"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
}
InternetExchangeLAN represents one of the networks (LANs) of an Internet exchange point, with details like MTU, VLAN support, etc.
type InternetExchangePrefix ¶
type InternetExchangePrefix struct {
ID int `json:"id"`
InternetExchangeLANID int `json:"ixlan_id"`
InternetExchangeLAN InternetExchangeLAN `json:"ixlan,omitempty"`
Protocol string `json:"protocol"`
Prefix string `json:"prefix"`
InDFZ bool `json:"in_dfz"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
}
InternetExchangePrefix represents a prefix used by an Internet exchange point, directly linked to an InternetExchangeLAN.
type Network ¶
type Network struct {
ID int `json:"id"`
OrganizationID int `json:"org_id"`
Organization Organization `json:"org,omitempty"`
Name string `json:"name"`
AKA string `json:"aka"`
NameLong string `json:"name_long"`
Website string `json:"website"`
ASN int `json:"asn"`
LookingGlass string `json:"looking_glass"`
RouteServer string `json:"route_server"`
IRRASSet string `json:"irr_as_set"`
InfoType string `json:"info_type"`
InfoTypes []string `json:"info_types"`
InfoPrefixes4 int `json:"info_prefixes4"`
InfoPrefixes6 int `json:"info_prefixes6"`
InfoTraffic string `json:"info_traffic"`
InfoRatio string `json:"info_ratio"`
InfoScope string `json:"info_scope"`
InfoUnicast bool `json:"info_unicast"`
InfoMulticast bool `json:"info_multicast"`
InfoIPv6 bool `json:"info_ipv6"`
InfoNeverViaRouteServers bool `json:"info_never_via_route_servers"`
InternetExchangeCount int `json:"ix_count"`
FacilityCount int `json:"fac_count"`
Notes string `json:"notes"`
NetworkInternetExchangeLANUpdated time.Time `json:"netixlan_updated"`
NetworkFacilityUpdated time.Time `json:"netfac_updated"`
NetworkContactUpdated time.Time `json:"poc_updated"`
PolicyURL string `json:"policy_url"`
PolicyGeneral string `json:"policy_general"`
PolicyLocations string `json:"policy_locations"`
PolicyRatio bool `json:"policy_ratio"`
PolicyContracts string `json:"policy_contracts"`
NetworkFacilitySet []int `json:"netfac_set"`
NetworkInternetExchangeLANSet []int `json:"netixlan_set"`
NetworkContactSet []int `json:"poc_set"`
AllowIXPUpdate bool `json:"allow_ixp_update"`
StatusDashboard string `json:"status_dashboard"`
RIRStatus string `json:"rir_status"`
RIRStatusUpdated time.Time `json:"rir_status_updated"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
SocialMedia []SocialMedia `json:"social_media"`
}
Network represents an Autonomous System identified by an AS number and other details. It belongs to an Organization, contains one or more NetworkContact, and is part of several Facility and InternetExchangeLAN.
type NetworkContact ¶
type NetworkContact struct {
ID int `json:"id"`
NetworkID int `json:"net_id"`
Network Network `json:"net"`
Role string `json:"role"`
Visible string `json:"visible"`
Name string `json:"name"`
Phone string `json:"phone"`
Email string `json:"email"`
URL string `json:"url"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
}
NetworkContact represents a contact for a network.
type NetworkFacility ¶
type NetworkFacility struct {
ID int `json:"id"`
Name string `json:"name"`
City string `json:"city"`
Country string `json:"country"`
NetworkID int `json:"net_id"`
Network Network `json:"net,omitempty"`
FacilityID int `json:"fac_id"`
Facility Facility `json:"fac,omitempty"`
LocalASN int `json:"local_asn"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
}
NetworkFacility links a Network with a Facility, indicating where a network is located. It can be used to search common facilities between several networks to know where they can interconnect directly.
type NetworkInternetExchangeLAN ¶
type NetworkInternetExchangeLAN struct {
ID int `json:"id"`
NetworkID int `json:"net_id"`
Network Network `json:"net,omitempty"`
InternetExchangeID int `json:"ix_id"`
InternetExchange InternetExchange `json:"ix,omitempty"`
Name string `json:"name"`
InternetExchangeLANID int `json:"ixlan_id"`
InternetExchangeLAN InternetExchangeLAN `json:"ixlan,omitempty"`
Notes string `json:"notes"`
Speed int `json:"speed"`
ASN int `json:"asn"`
IPAddr4 string `json:"ipaddr4"`
IPAddr6 string `json:"ipaddr6"`
IsRSPeer bool `json:"is_rs_peer"`
BFDSupport bool `json:"bfd_support"`
Operational bool `json:"operational"`
NetworkSideID int `json:"net_side_id"`
InternetExchangeSideID int `json:"ix_side_id"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
}
NetworkInternetExchangeLAN represents a network's connection to an Internet exchange LAN. It can be used to find common IX LANs between several networks.
type Option ¶
type Option func(*API)
Option configures an API instance.
func WithAPIKey ¶
WithAPIKey sets the API key for authentication.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client.
type Organization ¶
type Organization struct {
ID int `json:"id"`
Name string `json:"name"`
AKA string `json:"aka"`
NameLong string `json:"name_long"`
Website string `json:"website"`
Notes string `json:"notes"`
Require2FA bool `json:"require_2fa"`
NetworkSet []int `json:"net_set"`
FacilitySet []int `json:"fac_set"`
InternetExchangeSet []int `json:"ix_set"`
CarrierSet []int `json:"carrier_set"`
CampusSet []int `json:"campus_set"`
Address1 string `json:"address1"`
Address2 string `json:"address2"`
City string `json:"city"`
Country string `json:"country"`
State string `json:"state"`
Zipcode string `json:"zipcode"`
Floor string `json:"floor"`
Suite string `json:"suite"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Status string `json:"status"`
SocialMedia []SocialMedia `json:"social_media"`
}
Organization represents an enterprise linked to networks, facilities, and internet exchange points.
type SocialMedia ¶
SocialMedia represents a social media link for a PeeringDB entity.