Documentation
¶
Index ¶
- Variables
- type APIError
- type AbuseCategoryCount
- type AbuseContact
- type AbuseReports
- type Account
- type AccountResponse
- type AnonymizerExemptionReason
- type AsnConnectivity
- type AsnEstimatedCapacity
- type AsnExchange
- type AsnExchangePort
- type Blocklist
- type CallOption
- type Catalog
- type CatalogResponse
- type Client
- func (c *Client) Account(ctx context.Context) (*Account, error)
- func (c *Client) Catalog(ctx context.Context) (*Catalog, error)
- func (c *Client) GeoIP(ctx context.Context, ip string, opts ...CallOption) (*GeoIPData, error)
- func (c *Client) Intelligence(ctx context.Context, ip string, opts ...CallOption) (*IntelligenceData, error)
- type Company
- type CpeObservation
- type CpePart
- type Currency
- type DNSHostnameEvidence
- type DNSPtrEvidence
- type DNSRecords
- type ErrorCode
- type ErrorResponse
- type GeoIPAs
- type GeoIPData
- type GeoIPResponse
- type Geolocation
- type IntelligenceAs
- type IntelligenceData
- type IntelligenceResponse
- type LedgerEntry
- type LiveIntelligence
- type LiveIntelligenceTag
- type LookupRequest
- type MobileCarrier
- type NetworkClass
- type NetworkClassEvidence
- type NetworkClassSource
- type NetworkClassification
- type NetworkInfo
- type Option
- type Price
- type Product
- type PtrAsnMismatchIntelligence
- type PtrConfidence
- type PtrConfidenceLevel
- type PtrDatasetName
- type PtrEvidence
- type PtrEvidenceSource
- type PtrHint
- type PtrHintKind
- type PtrIntelligence
- type PtrLocatedIntelligence
- type PtrMetroLocation
- type PtrOperator
- type PtrUnmatchedIntelligence
- type ResourceTransfer
- type RevokedNetworkTag
- type RpkiInfo
- type RpkiRtr
- type RpkiSource
- type RpkiStatus
- type RpkiValidator
- type SegmentProbe
- type ThreatInfo
- type ThreatScores
- type TimeZone
- type Wallet
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidRequest = errors.New("ipmax: invalid request") ErrInsufficientBalance = errors.New("ipmax: insufficient balance") ErrNotFound = errors.New("ipmax: not found") ErrConflict = errors.New("ipmax: conflict") ErrRateLimited = errors.New("ipmax: rate limited") ErrServer = errors.New("ipmax: server error") )
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type AbuseCategoryCount ¶
type AbuseContact ¶
type AbuseReports ¶
type AbuseReports struct {
ConfidenceScore int `json:"confidence_score"`
TotalReports int `json:"total_reports"`
DistinctReporters int `json:"distinct_reporters"`
LastReportedAt *string `json:"last_reported_at"`
IsWhitelisted *bool `json:"is_whitelisted"`
Categories []AbuseCategoryCount `json:"categories"`
}
type Account ¶
type Account struct {
ID string `json:"id"`
Name string `json:"name"`
KeyPrefix string `json:"keyPrefix"`
Wallets []Wallet `json:"wallets"`
Entries []LedgerEntry `json:"entries"`
}
type AccountResponse ¶
type AnonymizerExemptionReason ¶
type AnonymizerExemptionReason string
const ( AnonymizerExemptionCloudflareCDNOrigin AnonymizerExemptionReason = "cloudflare_cdn_origin" AnonymizerExemptionSearchEngineCrawler AnonymizerExemptionReason = "search_engine_crawler" )
type AsnConnectivity ¶
type AsnConnectivity struct {
DeclaredTraffic string `json:"declared_traffic"`
ExchangesTotal *int `json:"exchanges_total,omitempty"`
EstimatedCapacity AsnEstimatedCapacity `json:"estimated_capacity"`
Exchanges []AsnExchange `json:"exchanges"`
}
type AsnEstimatedCapacity ¶
type AsnExchange ¶
type AsnExchange struct {
Name string `json:"name"`
CountryCode string `json:"countryCode,omitempty"`
Type string `json:"type"`
Ports []AsnExchangePort `json:"ports"`
}
type AsnExchangePort ¶
type CallOption ¶
type CallOption func(*callOptions)
func WithIdempotencyKey ¶
func WithIdempotencyKey(key string) CallOption
type CatalogResponse ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Intelligence ¶
func (c *Client) Intelligence(ctx context.Context, ip string, opts ...CallOption) (*IntelligenceData, error)
type CpeObservation ¶
type DNSHostnameEvidence ¶
type DNSPtrEvidence ¶
type DNSRecords ¶
type DNSRecords struct {
Ptr []string `json:"ptr"`
PtrEvidence []DNSPtrEvidence `json:"ptr_evidence"`
Hostnames []DNSHostnameEvidence `json:"hostnames"`
Sources []string `json:"sources"`
SnapshotID *string `json:"snapshot_id"`
UpdatedAt *string `json:"updated_at"`
}
type ErrorCode ¶
type ErrorCode int
const ( ErrorCodeInvalidRequest ErrorCode = 1000 ErrorCodeInvalidPayload ErrorCode = 1001 ErrorCodeInvalidIP ErrorCode = 1002 ErrorCodeIPNotFound ErrorCode = 1003 ErrorCodeRouteNotFound ErrorCode = 1004 ErrorCodeInvalidAPIKey ErrorCode = 1010 ErrorCodeRateLimitExceeded ErrorCode = 1011 ErrorCodeInternalError ErrorCode = 1401 ErrorCodeInsufficientBalance ErrorCode = 1500 ErrorCodeIdempotencyKeyConflict ErrorCode = 1501 )
type ErrorResponse ¶
type GeoIPData ¶
type GeoIPData struct {
As GeoIPAs `json:"as"`
IP string `json:"ip"`
Geo Geolocation `json:"geo"`
Netmask string `json:"netmask"`
PrefixLength *int `json:"prefix_length"`
IsBogon bool `json:"is_bogon"`
Currency *Currency `json:"currency,omitempty"`
TimeZone *TimeZone `json:"time_zone,omitempty"`
CallingCode *string `json:"calling_code,omitempty"`
}
type GeoIPResponse ¶
type Geolocation ¶
type Geolocation struct {
City string `json:"city"`
Region string `json:"region"`
District string `json:"district"`
RegionCode string `json:"region_code"`
Adcode string `json:"adcode"`
Country string `json:"country"`
CountryCode string `json:"country_code"`
Continent string `json:"continent"`
ContinentCode string `json:"continent_code"`
Latitude *float64 `json:"latitude"`
Longitude *float64 `json:"longitude"`
Timezone string `json:"timezone"`
PostalCode string `json:"postal_code"`
Radius *float64 `json:"radius"`
AreaCode string `json:"area_code,omitempty"`
PlusCode string `json:"plus_code,omitempty"`
CountryEn string `json:"country_en,omitempty"`
CountryZh string `json:"country_zh,omitempty"`
RegionEn string `json:"region_en,omitempty"`
RegionZh string `json:"region_zh,omitempty"`
CityEn string `json:"city_en,omitempty"`
CityZh string `json:"city_zh,omitempty"`
DistrictEn string `json:"district_en,omitempty"`
DistrictZh string `json:"district_zh,omitempty"`
}
type IntelligenceAs ¶
type IntelligenceAs struct {
ASN string `json:"asn"`
Name string `json:"name"`
NameEn string `json:"name_en,omitempty"`
CountryCode string `json:"countryCode,omitempty"`
Domain string `json:"domain"`
Type string `json:"type"`
Class string `json:"class,omitempty"`
Tags []string `json:"tags,omitempty"`
Connectivity *AsnConnectivity `json:"connectivity,omitempty"`
}
type IntelligenceData ¶
type IntelligenceData struct {
As IntelligenceAs `json:"as"`
Intelligence LiveIntelligence `json:"intelligence"`
IP string `json:"ip"`
Network *NetworkInfo `json:"network,omitempty"`
NetworkClass NetworkClassification `json:"network_class"`
Mobile *MobileCarrier `json:"mobile,omitempty"`
Threat *ThreatInfo `json:"threat,omitempty"`
Rpki *RpkiInfo `json:"rpki,omitempty"`
Company *Company `json:"company,omitempty"`
Abuse *AbuseContact `json:"abuse,omitempty"`
DNS *DNSRecords `json:"dns,omitempty"`
IsBogon bool `json:"is_bogon"`
IsAnycast *bool `json:"is_anycast"`
IsMobile *bool `json:"is_mobile"`
IsHosting *bool `json:"is_hosting"`
IsSatellite *bool `json:"is_satellite"`
}
type IntelligenceResponse ¶
type IntelligenceResponse struct {
Status bool `json:"status"`
Data IntelligenceData `json:"data"`
}
type LedgerEntry ¶
type LiveIntelligence ¶
type LiveIntelligence struct {
Ptr []PtrIntelligence `json:"ptr"`
Nameservers []string `json:"nameservers"`
Cpes []CpeObservation `json:"cpes"`
Tags []LiveIntelligenceTag `json:"tags"`
RevokedTags []RevokedNetworkTag `json:"revoked_tags"`
UsageType *string `json:"usage_type"`
Rpki *RpkiInfo `json:"rpki,omitempty"`
Abuse *AbuseReports `json:"abuse,omitempty"`
Transfers []ResourceTransfer `json:"transfers,omitempty"`
SegmentProbe *SegmentProbe `json:"segment_probe,omitempty"`
}
type LiveIntelligenceTag ¶
type LiveIntelligenceTag string
const ( LiveIntelligenceTagHosting LiveIntelligenceTag = "hosting" LiveIntelligenceTagPublicDNSResolver LiveIntelligenceTag = "public_dns_resolver" LiveIntelligenceTagWebServer LiveIntelligenceTag = "web_server" LiveIntelligenceTagVPN LiveIntelligenceTag = "vpn" LiveIntelligenceTagResidentialProxy LiveIntelligenceTag = "residential_proxy" )
type LookupRequest ¶
type LookupRequest struct {
IP string `json:"ip"`
}
type MobileCarrier ¶
type NetworkClass ¶
type NetworkClass string
const ( NetworkClassMobile NetworkClass = "mobile" NetworkClassHosting NetworkClass = "hosting" NetworkClassResidential NetworkClass = "residential" NetworkClassBusiness NetworkClass = "business" NetworkClassOrganization NetworkClass = "organization" NetworkClassGovernment NetworkClass = "government" NetworkClassMilitary NetworkClass = "military" NetworkClassEducation NetworkClass = "education" NetworkClassLibrary NetworkClass = "library" NetworkClassDedicated NetworkClass = "dedicated" NetworkClassSatellite NetworkClass = "satellite" NetworkClassIXP NetworkClass = "ixp" NetworkClassSearchEngine NetworkClass = "search_engine" NetworkClassAICrawler NetworkClass = "ai_crawler" NetworkClassUnknown NetworkClass = "unknown" )
type NetworkClassEvidence ¶
type NetworkClassEvidence struct {
Class NetworkClass `json:"class"`
Source NetworkClassSource `json:"source"`
Scope string `json:"scope"`
Value string `json:"value"`
}
type NetworkClassSource ¶
type NetworkClassSource string
const ( NetworkClassSourceDomesticISP NetworkClassSource = "domestic_isp" NetworkClassSourceUsageType NetworkClassSource = "usage_type" NetworkClassSourceMobileCarrier NetworkClassSource = "mobile_carrier" NetworkClassSourceConnectionType NetworkClassSource = "connection_type" NetworkClassSourceNetworkTag NetworkClassSource = "network_tag" NetworkClassSourceThreatIntelligence NetworkClassSource = "threat_intelligence" NetworkClassSourceASNTag NetworkClassSource = "asn_tag" NetworkClassSourceIXP NetworkClassSource = "ixp" NetworkClassSourceNone NetworkClassSource = "none" )
type NetworkClassification ¶
type NetworkClassification struct {
Primary NetworkClass `json:"primary"`
Confidence string `json:"confidence"`
Source NetworkClassSource `json:"source"`
Conflicts []NetworkClass `json:"conflicts"`
Evidence []NetworkClassEvidence `json:"evidence"`
}
type NetworkInfo ¶
type Option ¶
type Option func(*Client)
func WithBaseURL ¶
func WithCacheSize ¶
func WithCacheTTL ¶
func WithHTTPClient ¶
func WithMaxRetries ¶
func WithTimeout ¶
type PtrAsnMismatchIntelligence ¶
type PtrAsnMismatchIntelligence struct {
Hostname string `json:"hostname"`
Status string `json:"status"`
Operator PtrOperator `json:"operator"`
ObservedASN string `json:"observed_asn"`
Evidence PtrEvidence `json:"evidence"`
}
type PtrConfidence ¶
type PtrConfidence struct {
Level PtrConfidenceLevel `json:"level"`
Score float64 `json:"score"`
}
type PtrConfidenceLevel ¶
type PtrConfidenceLevel string
const ( PtrConfidenceHigh PtrConfidenceLevel = "high" PtrConfidenceMedium PtrConfidenceLevel = "medium" PtrConfidenceLow PtrConfidenceLevel = "low" )
type PtrDatasetName ¶
type PtrDatasetName string
const ( PtrDatasetGeonames PtrDatasetName = "geonames" PtrDatasetOurAirports PtrDatasetName = "ourairports" PtrDatasetOperatorOverrides PtrDatasetName = "operator-overrides" PtrDatasetUNLOCODE PtrDatasetName = "unlocode" )
type PtrEvidence ¶
type PtrEvidence struct {
RuleID string `json:"rule_id"`
RulesetVersion string `json:"ruleset_version"`
Sources []PtrEvidenceSource `json:"sources"`
}
type PtrEvidenceSource ¶
type PtrEvidenceSource struct {
Dataset PtrDatasetName `json:"dataset"`
Version string `json:"version"`
}
type PtrHint ¶
type PtrHint struct {
Value string `json:"value"`
Kind PtrHintKind `json:"kind"`
}
type PtrHintKind ¶
type PtrHintKind string
const ( PtrHintIATA PtrHintKind = "iata" PtrHintUNLOCODE PtrHintKind = "unlocode" PtrHintCLLI PtrHintKind = "clli" PtrHintCityName PtrHintKind = "city_name" PtrHintOperatorCode PtrHintKind = "operator_code" )
type PtrIntelligence ¶
type PtrIntelligence struct {
Hostname string
Status string
Located *PtrLocatedIntelligence
AsnMismatch *PtrAsnMismatchIntelligence
Unmatched *PtrUnmatchedIntelligence
}
func (PtrIntelligence) MarshalJSON ¶
func (p PtrIntelligence) MarshalJSON() ([]byte, error)
func (*PtrIntelligence) UnmarshalJSON ¶
func (p *PtrIntelligence) UnmarshalJSON(data []byte) error
type PtrLocatedIntelligence ¶
type PtrLocatedIntelligence struct {
Hostname string `json:"hostname"`
Status string `json:"status"`
Operator PtrOperator `json:"operator"`
Hint PtrHint `json:"hint"`
Location PtrMetroLocation `json:"location"`
Confidence PtrConfidence `json:"confidence"`
Evidence PtrEvidence `json:"evidence"`
}
type PtrMetroLocation ¶
type PtrMetroLocation struct {
City string `json:"city"`
Region *string `json:"region"`
RegionCode *string `json:"region_code"`
Country string `json:"country"`
CountryCode string `json:"country_code"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
Precision string `json:"precision"`
}
type PtrOperator ¶
type ResourceTransfer ¶
type ResourceTransfer struct {
TransferTime string `json:"transfer_time"`
TransferType string `json:"transfer_type"`
SourceResource string `json:"source_resource"`
RecipientResource string `json:"recipient_resource"`
SourceRegistry string `json:"source_registry"`
RecipientRegistry string `json:"recipient_registry"`
SourceHolder string `json:"source_holder"`
RecipientHolder string `json:"recipient_holder"`
}
type RevokedNetworkTag ¶
type RevokedNetworkTag string
const ( RevokedNetworkTagBusinessBroadband RevokedNetworkTag = "business_broadband" RevokedNetworkTagHomeISP RevokedNetworkTag = "home_isp" RevokedNetworkTagMobileISP RevokedNetworkTag = "mobile_isp" )
type RpkiInfo ¶
type RpkiInfo struct {
Status RpkiStatus `json:"status"`
Source RpkiSource `json:"source,omitempty"`
RouteSource string `json:"route_source,omitempty"`
OriginASN string `json:"origin_asn,omitempty"`
RoutePrefix string `json:"route_prefix,omitempty"`
RoaPrefix string `json:"roa_prefix,omitempty"`
RoaASN string `json:"roa_asn,omitempty"`
MaxLength *int `json:"max_length,omitempty"`
Ta string `json:"ta,omitempty"`
Rtr *RpkiRtr `json:"rtr,omitempty"`
Validator *RpkiValidator `json:"validator,omitempty"`
}
type RpkiSource ¶
type RpkiSource string
const ( RpkiSourceRTRLive RpkiSource = "RTR Live" RpkiSourceLocalCache RpkiSource = "Local Cache" RpkiSourceLocalDB RpkiSource = "Local DB" )
type RpkiStatus ¶
type RpkiStatus string
const ( RpkiStatusValid RpkiStatus = "valid" RpkiStatusInvalidASN RpkiStatus = "invalid_asn" RpkiStatusInvalidLength RpkiStatus = "invalid_length" RpkiStatusUnknown RpkiStatus = "unknown" RpkiStatusNotRouted RpkiStatus = "not_routed" )
type RpkiValidator ¶
type SegmentProbe ¶
type SegmentProbe struct {
IP string `json:"ip"`
Ports []int `json:"ports"`
Tags []LiveIntelligenceTag `json:"tags"`
}
type ThreatInfo ¶
type ThreatInfo struct {
IsTor *bool `json:"is_tor"`
IsVPN *bool `json:"is_vpn"`
IsICloudRelay *bool `json:"is_icloud_relay"`
IsCloudflareWarp *bool `json:"is_cloudflare_warp"`
IsProxy *bool `json:"is_proxy"`
IsDatacenter *bool `json:"is_datacenter"`
IsAnonymous *bool `json:"is_anonymous"`
IsKnownAttacker *bool `json:"is_known_attacker"`
IsKnownAbuser *bool `json:"is_known_abuser"`
IsThreat *bool `json:"is_threat"`
IsBogon bool `json:"is_bogon"`
Blocklists []Blocklist `json:"blocklists"`
BlocklistCount int `json:"blocklist_count"`
Scores ThreatScores `json:"scores"`
AnonymizerExemptions []AnonymizerExemptionReason `json:"anonymizer_exemptions,omitempty"`
}
type ThreatScores ¶
Click to show internal directories.
Click to hide internal directories.