services

package
v0.0.0-...-cebd656 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASNDetailTable

func ASNDetailTable() *schema.Table

ASNDetailTable returns the table definition for detailed ASN lookups.

func AbuseContactTable

func AbuseContactTable() *schema.Table

AbuseContactTable returns the table definition for dedicated abuse contact lookups.

func IPGeolocationTable

func IPGeolocationTable() *schema.Table

IPGeolocationTable returns the table definition for IP geolocation lookups.

func IPSecurityTable

func IPSecurityTable() *schema.Table

IPSecurityTable returns the table definition for dedicated IP security lookups.

func UserAgentTable

func UserAgentTable() *schema.Table

UserAgentTable returns the table definition for user-agent parsing results.

Types

type ASNDetailFlat

type ASNDetailFlat struct {
	QueryIP          string `json:"query_ip"`
	QueryASN         string `json:"query_asn"`
	ASNumber         string `json:"as_number"`
	Organization     string `json:"organization"`
	Country          string `json:"country"`
	Type             string `json:"type"`
	Domain           string `json:"domain"`
	DateAllocated    string `json:"date_allocated"`
	ASNName          string `json:"asn_name"`
	AllocationStatus string `json:"allocation_status"`
	NumIPv4Routes    string `json:"num_of_ipv4_routes"`
	NumIPv6Routes    string `json:"num_of_ipv6_routes"`
	RIR              string `json:"rir"`

	// Optional modules (asn_include). NULL unless requested.
	Routes        *string `json:"routes"`         // comma-separated CIDR prefixes
	Peers         *string `json:"peers"`          // comma-separated AS numbers
	Upstreams     *string `json:"upstreams"`      // comma-separated AS numbers
	Downstreams   *string `json:"downstreams"`    // comma-separated AS numbers
	WhoisResponse *string `json:"whois_response"` // raw WHOIS record text
}

ASNDetailFlat is a flattened ASN detail response for CloudQuery columns.

The base columns are always populated. The last five (routes, peers, upstreams, downstreams, whois_response) are optional modules of the /v3/asn endpoint that can be very large, so they are fetched only when listed in the asn_include spec option. They are NULL when not requested, and an empty string when requested but the ASN has none.

type AbuseContactFlat

type AbuseContactFlat struct {
	IP string `json:"ip"`
	AbuseFields
}

AbuseContactFlat is a flattened abuse contact response for CloudQuery columns. It exposes every field of the API's `abuse` object (see AbuseFields).

type AbuseFields

type AbuseFields struct {
	Route        string `json:"route"`
	Country      string `json:"country"`
	Name         string `json:"name"`
	Organization string `json:"organization"`
	Kind         string `json:"kind"`
	Address      string `json:"address"`
	Emails       string `json:"emails"`        // comma-separated
	PhoneNumbers string `json:"phone_numbers"` // comma-separated
}

AbuseFields is the complete `abuse` object of the IPGeolocation.io API, flattened for CloudQuery. ipgeolocation_abuse_contact embeds it directly (columns: route, country, name, ...); ipgeolocation_ip_geolocation nests it so the columns are prefixed (abuse_route, abuse_country, abuse_name, ...) and cannot collide with the location/network columns of the same names.

Reference: https://ipgeolocation.io/documentation/ip-abuse-contact-api.html

type IPGeolocationFlat

type IPGeolocationFlat struct {
	// Core
	IP     string `json:"ip"`
	Domain string `json:"domain"`

	// Hostname is only requested when include_hostname is true (resolution mode
	// set by hostname_lookup); NULL otherwise. If the hostname cannot be
	// resolved the API returns the queried IP itself.
	Hostname *string `json:"hostname"`

	// Location
	ContinentCode       string `json:"continent_code"`
	ContinentName       string `json:"continent_name"`
	CountryCode2        string `json:"country_code2"`
	CountryCode3        string `json:"country_code3"`
	CountryName         string `json:"country_name"`
	CountryNameOfficial string `json:"country_name_official"`
	CountryCapital      string `json:"country_capital"`
	StateProv           string `json:"state_prov"`
	StateCode           string `json:"state_code"`
	District            string `json:"district"`
	City                string `json:"city"`
	Zipcode             string `json:"zipcode"`
	Latitude            string `json:"latitude"`
	Longitude           string `json:"longitude"`
	IsEU                bool   `json:"is_eu"`
	GeonameID           string `json:"geoname_id"`

	// Geo accuracy (optional; only requested when include_geo_accuracy is
	// true, NULL otherwise): locality/neighbourhood, accuracy radius in km
	// around latitude/longitude, and confidence (low, medium, high).
	Locality       *string `json:"locality"`
	AccuracyRadius *string `json:"accuracy_radius"`
	Confidence     *string `json:"confidence"`

	// DMACode is the Designated Market Area code (optional; only requested when
	// include_dma_code is true, NULL otherwise). The API only fills it for US
	// locations, so it is an empty string elsewhere.
	DMACode *string `json:"dma_code"`

	// Country metadata
	CallingCode string `json:"calling_code"`
	TLD         string `json:"tld"`
	Languages   string `json:"languages"` // comma-separated

	// Network
	ConnectionType  string `json:"connection_type"`
	Route           string `json:"route"`
	IsAnycast       bool   `json:"is_anycast"`
	IsCDN           bool   `json:"is_cdn"`
	CDNProviderName string `json:"cdn_provider_name"`

	// Currency
	CurrencyCode   string `json:"currency_code"`
	CurrencyName   string `json:"currency_name"`
	CurrencySymbol string `json:"currency_symbol"`

	// ASN
	ASNumber         string `json:"as_number"`
	ASNOrganization  string `json:"asn_organization"`
	ASNCountry       string `json:"asn_country"`
	ASNType          string `json:"asn_type"`
	ASNDomain        string `json:"asn_domain"`
	ASNDateAllocated string `json:"asn_date_allocated"`
	ASNRIR           string `json:"asn_rir"`

	// Company
	CompanyName   string `json:"company_name"`
	CompanyType   string `json:"company_type"`
	CompanyDomain string `json:"company_domain"`

	// Timezone
	TimezoneName            string  `json:"timezone_name"`
	TimezoneOffset          float64 `json:"timezone_offset"`
	TimezoneOffsetWithDST   float64 `json:"timezone_offset_with_dst"`
	TimezoneCurrentTime     string  `json:"timezone_current_time"`
	TimezoneCurrentTimeUnix float64 `json:"timezone_current_time_unix"`
	TimezoneAbbreviation    string  `json:"timezone_abbreviation"`
	TimezoneIsDST           bool    `json:"timezone_is_dst"`

	// Security data (optional; only requested when include_security is true).
	// Exposes every field of the API's `security` object as unprefixed columns
	// (threat_score, is_vpn, bot_type, is_corporate_gateway, ...). The pointer is
	// nil when the data was not requested, which makes all of these columns NULL
	// instead of a misleading false/0.
	*SecurityFields

	// Abuse contact data (optional; only requested when include_abuse is true).
	// Exposes every field of the API's `abuse` object as abuse_-prefixed columns
	// (abuse_route, abuse_country, abuse_name, abuse_organization, abuse_kind,
	// abuse_address, abuse_emails, abuse_phone_numbers). nil => NULL columns.
	Abuse *AbuseFields `json:"abuse"`
}

IPGeolocationFlat is a flattened representation of the IP Geolocation API response. CloudQuery tables work best with flat structs rather than deeply nested JSON.

func (*IPGeolocationFlat) String

func (f *IPGeolocationFlat) String() string

type IPSecurityFlat

type IPSecurityFlat struct {
	IP string `json:"ip"`
	SecurityFields
}

IPSecurityFlat is a flattened security/threat response for CloudQuery columns. It exposes every field of the API's `security` object (see SecurityFields).

type SecurityFields

type SecurityFields struct {
	ThreatScore int `json:"threat_score"`

	IsTor bool `json:"is_tor"`

	IsProxy              bool   `json:"is_proxy"`
	ProxyProviderNames   string `json:"proxy_provider_names"`
	ProxyConfidenceScore int    `json:"proxy_confidence_score"`
	ProxyLastSeen        string `json:"proxy_last_seen"`
	IsResidentialProxy   bool   `json:"is_residential_proxy"`

	IsVPN              bool   `json:"is_vpn"`
	VPNProviderNames   string `json:"vpn_provider_names"`
	VPNConfidenceScore int    `json:"vpn_confidence_score"`
	VPNLastSeen        string `json:"vpn_last_seen"`

	IsRelay           bool   `json:"is_relay"`
	RelayProviderName string `json:"relay_provider_name"`

	IsAnonymous     bool `json:"is_anonymous"`
	IsKnownAttacker bool `json:"is_known_attacker"`

	IsBot              bool   `json:"is_bot"`
	BotConfidenceScore int    `json:"bot_confidence_score"`
	BotOperatorName    string `json:"bot_operator_name"`
	BotType            string `json:"bot_type"`
	IsKnownGoodBot     bool   `json:"is_known_good_bot"`
	BotLastSeen        string `json:"bot_last_seen"`

	IsSpam bool `json:"is_spam"`

	IsCloudProvider   bool   `json:"is_cloud_provider"`
	CloudProviderName string `json:"cloud_provider_name"`

	IsCorporateGateway           bool   `json:"is_corporate_gateway"`
	CorporateGatewayType         string `json:"corporate_gateway_type"`
	CorporateGatewayProviderName string `json:"corporate_gateway_provider_name"`
}

SecurityFields is the complete `security` object of the IPGeolocation.io API, flattened for CloudQuery. It is defined once and embedded by every table that exposes security data (ipgeolocation_ip_geolocation and ipgeolocation_ip_security), so the two can never drift apart.

Array fields (provider names) are stored comma-separated, matching the convention used elsewhere in this plugin.

Reference: https://ipgeolocation.io/documentation/ip-security-api.html

type UserAgentFlat

type UserAgentFlat struct {
	UserAgentString string `json:"user_agent_string"`
	Name            string `json:"name"`
	Type            string `json:"type"`
	Version         string `json:"version"`
	VersionMajor    string `json:"version_major"`

	// Device
	DeviceName  string `json:"device_name"`
	DeviceType  string `json:"device_type"`
	DeviceBrand string `json:"device_brand"`
	DeviceCPU   string `json:"device_cpu"`

	// Engine
	EngineName         string `json:"engine_name"`
	EngineType         string `json:"engine_type"`
	EngineVersion      string `json:"engine_version"`
	EngineVersionMajor string `json:"engine_version_major"`

	// OS
	OSName         string `json:"os_name"`
	OSType         string `json:"os_type"`
	OSVersion      string `json:"os_version"`
	OSVersionMajor string `json:"os_version_major"`
	OSBuild        string `json:"os_build"`
}

UserAgentFlat is a flattened user-agent parse response for CloudQuery columns.

Jump to

Keyboard shortcuts

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