ipmax

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

README

ipmax-go

Go Reference

Go client for the IP-Max GeoIP and IP intelligence API. Standard library only, Go 1.24+.

Install

go get github.com/IPMaxxing/go-sdk

Quickstart

package main

import (
	"context"
	"fmt"
	"log"

	ipmax "github.com/IPMaxxing/go-sdk"
)

func main() {
	client := ipmax.NewClient("")
	ctx := context.Background()

	geo, err := client.GeoIP(ctx, "8.8.8.8")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(geo.Geo.City, geo.Geo.Timezone)

	intel, err := client.Intelligence(ctx, "8.8.8.8", ipmax.WithIdempotencyKey("order-1042-intel"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(intel.NetworkClass.Primary)
}

An empty API key falls back to the IPMAX_API_KEY environment variable. Catalog works without a key; Account, GeoIP and Intelligence need one.

Configuration

Option Default Description
WithBaseURL(string) https://api.ipm.ax API origin.
WithTimeout(d) 10s Per-attempt timeout.
WithMaxRetries(n) 2 Retries on network errors, 408, 429 and 5xx, honouring Retry-After.
WithCacheSize(n) 1024 Successful lookups kept in memory; 0 disables the cache.
WithCacheTTL(d) 5m Cache lifetime.
WithHTTPClient(c) http.DefaultClient Custom client for proxies, transports or tests.

Each lookup carries a fresh UUID v4 Idempotency-Key that is reused on every retry, so a retried request is never billed twice. Cached lookups make no request and cost nothing; WithIdempotencyKey skips the cache read. The client is safe for concurrent use.

Error handling

Non-2xx responses are returned as *ipmax.APIError, which also matches sentinel errors with errors.Is:

_, err := client.GeoIP(ctx, "192.0.2.1")
switch {
case errors.Is(err, ipmax.ErrNotFound):
	fmt.Println("not in the database")
case errors.Is(err, ipmax.ErrInsufficientBalance):
	fmt.Println("top up the geoip wallet")
case err != nil:
	var apiErr *ipmax.APIError
	if errors.As(err, &apiErr) {
		fmt.Println(apiErr.StatusCode, apiErr.Code, apiErr.Message, apiErr.RequestID, apiErr.RetryAfter)
	}
	log.Fatal(err)
}
Sentinel Status
ErrInvalidRequest 400, 413, 415
ErrUnauthorized 401
ErrInsufficientBalance 402
ErrNotFound 404
ErrConflict 409
ErrRateLimited 429
ErrServer 5xx

Transport failures and timeouts are returned as wrapped net/http and context errors.

License

Apache-2.0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRequest      = errors.New("ipmax: invalid request")
	ErrUnauthorized        = errors.New("ipmax: unauthorized")
	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 APIError struct {
	StatusCode int           `json:"-"`
	Code       ErrorCode     `json:"code"`
	Message    string        `json:"message"`
	RequestID  string        `json:"request_id"`
	Retryable  bool          `json:"retryable"`
	RetryAfter time.Duration `json:"-"`
}

func (*APIError) Error

func (e *APIError) Error() string

func (*APIError) Is

func (e *APIError) Is(target error) bool

type AbuseCategoryCount

type AbuseCategoryCount struct {
	ID    int `json:"id"`
	Count int `json:"count"`
}

type AbuseContact

type AbuseContact struct {
	Name    *string `json:"name"`
	Address *string `json:"address"`
	Country *string `json:"country"`
	Email   *string `json:"email"`
	Network *string `json:"network"`
	Phone   *string `json:"phone"`
	Source  string  `json:"source,omitempty"`
}

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 AccountResponse struct {
	Status bool    `json:"status"`
	Data   Account `json:"data"`
}

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 AsnEstimatedCapacity struct {
	LowerGbps float64  `json:"lower_gbps"`
	UpperGbps *float64 `json:"upper_gbps,omitempty"`
	Label     string   `json:"label"`
}

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 AsnExchangePort struct {
	CapacityGbps float64 `json:"capacity_gbps"`
	Operational  *bool   `json:"operational,omitempty"`
	RSPeer       *bool   `json:"rs_peer,omitempty"`
}

type Blocklist

type Blocklist struct {
	Name string `json:"name"`
	Site string `json:"site"`
	Type string `json:"type"`
}

type CallOption

type CallOption func(*callOptions)

func WithIdempotencyKey

func WithIdempotencyKey(key string) CallOption

type Catalog

type Catalog struct {
	Currency      string  `json:"currency"`
	Prices        []Price `json:"prices"`
	PurchaseEmail string  `json:"purchaseEmail"`
	Available     bool    `json:"available"`
}

type CatalogResponse

type CatalogResponse struct {
	Status bool    `json:"status"`
	Data   Catalog `json:"data"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiKey string, opts ...Option) *Client

func (*Client) Account

func (c *Client) Account(ctx context.Context) (*Account, error)

func (*Client) Catalog

func (c *Client) Catalog(ctx context.Context) (*Catalog, error)

func (*Client) GeoIP

func (c *Client) GeoIP(ctx context.Context, ip string, opts ...CallOption) (*GeoIPData, error)

func (*Client) Intelligence

func (c *Client) Intelligence(ctx context.Context, ip string, opts ...CallOption) (*IntelligenceData, error)

type Company

type Company struct {
	Name    *string `json:"name"`
	Address *string `json:"address"`
	Domain  *string `json:"domain"`
	Phone   *string `json:"phone"`
	Type    *string `json:"type"`
	Network *string `json:"network"`
	Country *string `json:"country"`
	Source  string  `json:"source,omitempty"`
}

type CpeObservation

type CpeObservation struct {
	Cpe     string  `json:"cpe"`
	Part    CpePart `json:"part"`
	Vendor  string  `json:"vendor"`
	Product string  `json:"product"`
	Version *string `json:"version"`
}

type CpePart

type CpePart string
const (
	CpePartApplication     CpePart = "application"
	CpePartOperatingSystem CpePart = "operating_system"
	CpePartHardware        CpePart = "hardware"
)

type Currency

type Currency struct {
	Name   string `json:"name"`
	Code   string `json:"code"`
	Symbol string `json:"symbol"`
	Native string `json:"native"`
	Plural string `json:"plural"`
}

type DNSHostnameEvidence

type DNSHostnameEvidence struct {
	Hostname         string   `json:"hostname"`
	Kinds            []string `json:"kinds"`
	Sources          []string `json:"sources"`
	ForwardConfirmed bool     `json:"forward_confirmed"`
	FirstSeen        *string  `json:"first_seen"`
	LastSeen         *string  `json:"last_seen"`
}

type DNSPtrEvidence

type DNSPtrEvidence struct {
	Hostname         string   `json:"hostname"`
	Sources          []string `json:"sources"`
	ForwardConfirmed bool     `json:"forward_confirmed"`
	FirstSeen        *string  `json:"first_seen"`
	LastSeen         *string  `json:"last_seen"`
}

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
	ErrorCodeServiceUnavailable     ErrorCode = 1400
	ErrorCodeInternalError          ErrorCode = 1401
	ErrorCodeInsufficientBalance    ErrorCode = 1500
	ErrorCodeIdempotencyKeyConflict ErrorCode = 1501
)

type ErrorResponse

type ErrorResponse struct {
	Status bool     `json:"status"`
	Error  APIError `json:"error"`
}

type GeoIPAs

type GeoIPAs 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 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 GeoIPResponse struct {
	Status bool      `json:"status"`
	Data   GeoIPData `json:"data"`
}

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 LedgerEntry struct {
	ID            string  `json:"id"`
	Product       Product `json:"product"`
	Kind          string  `json:"kind"`
	AmountMicros  float64 `json:"amountMicros"`
	BalanceMicros float64 `json:"balanceMicros"`
	Reference     string  `json:"reference"`
	CreatedAt     string  `json:"createdAt"`
}

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 MobileCarrier struct {
	MCC   string `json:"mcc"`
	MNC   string `json:"mnc"`
	Brand string `json:"brand"`
}

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 NetworkInfo struct {
	ConnectionType string   `json:"connection_type"`
	UsageType      string   `json:"usage_type"`
	AddressType    string   `json:"address_type,omitempty"`
	NetSpeed       string   `json:"net_speed"`
	Tags           []string `json:"tags"`
}

type Option

type Option func(*Client)

func WithBaseURL

func WithBaseURL(baseURL string) Option

func WithCacheSize

func WithCacheSize(size int) Option

func WithCacheTTL

func WithCacheTTL(ttl time.Duration) Option

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

func WithMaxRetries

func WithMaxRetries(maxRetries int) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type Price

type Price struct {
	Product    Product `json:"product"`
	Name       string  `json:"name"`
	UnitMicros float64 `json:"unitMicros"`
}

type Product

type Product string
const (
	ProductGeoIP        Product = "geoip"
	ProductIntelligence Product = "intelligence"
)

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 PtrOperator struct {
	Name   string `json:"name"`
	ASN    string `json:"asn"`
	Suffix string `json:"suffix"`
}

type PtrUnmatchedIntelligence

type PtrUnmatchedIntelligence struct {
	Hostname string `json:"hostname"`
	Status   string `json:"status"`
}

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 RpkiRtr

type RpkiRtr struct {
	Source      string `json:"source"`
	Server      string `json:"server,omitempty"`
	LastUpdated int64  `json:"lastUpdated"`
}

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 RpkiValidator struct {
	Source      string `json:"source"`
	Engine      string `json:"engine"`
	LastUpdated int64  `json:"lastUpdated"`
}

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

type ThreatScores struct {
	VPNScore    *float64 `json:"vpn_score"`
	ProxyScore  *float64 `json:"proxy_score"`
	ThreatScore *float64 `json:"threat_score"`
	TrustScore  *float64 `json:"trust_score"`
}

type TimeZone

type TimeZone struct {
	Name        string `json:"name"`
	Abbr        string `json:"abbr"`
	Offset      string `json:"offset"`
	IsDST       bool   `json:"is_dst"`
	CurrentTime string `json:"current_time"`
}

type Wallet

type Wallet struct {
	Product       Product `json:"product"`
	BalanceMicros float64 `json:"balanceMicros"`
}

Jump to

Keyboard shortcuts

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