apis

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Copyright © 2024 Alessandro Riva

Licensed under the MIT License. See the LICENSE file for details.

Licensed under the MIT License. See the LICENSE file for details.

Licensed under the MIT License. See the LICENSE file for details.

Index

Constants

View Source
const IPInfoBaseURL = "https://ipinfo.io"

Variables

This section is empty.

Functions

This section is empty.

Types

type AbuseIPDBResponse

type AbuseIPDBResponse struct {
	Data struct {
		IPAddress            string   `json:"ipAddress"`
		IsPublic             bool     `json:"isPublic"`
		IPVersion            int      `json:"ipVersion"`
		IsWhitelisted        bool     `json:"isWhitelisted"`
		AbuseConfidenceScore int      `json:"abuseConfidenceScore"`
		CountryCode          string   `json:"countryCode"`
		UsageType            string   `json:"usageType"`
		ISP                  string   `json:"isp"`
		Domain               string   `json:"domain"`
		Hostnames            []string `json:"hostnames"`
		TotalReports         int      `json:"totalReports"`
		LastReportedAt       string   `json:"lastReportedAt"`
		Reports              []struct {
			ReporterID      int    `json:"reporterId"`
			ReporterCountry string `json:"reporterCountryCode"`
			ReportedAt      string `json:"reportedAt"`
			Comment         string `json:"comment"`
		} `json:"reports"`
	} `json:"data"`
}

func GetAbuseIPDBInfo

func GetAbuseIPDBInfo(ip net.IP, apiKey string) *AbuseIPDBResponse

getAbuseIPDBInfo fetches data from AbuseIPDB for a specific IP address

type GreyNoiseInfo

type GreyNoiseInfo struct {
	IP             string `json:"ip"`
	Noise          bool   `json:"noise"`
	Riot           bool   `json:"riot"`
	Classification string `json:"classification"`
	Link           string `json:"link"`
	LastSeen       string `json:"last_seen"`
	Message        string `json:"message"`
}

func GetGreyNoiseData

func GetGreyNoiseData(ip net.IP, apiKey string) *GreyNoiseInfo

Get threat intelligence from GreyNoise API

type IPInfo

type IPInfo struct {
	IP       string `json:"ip"`
	Country  string `json:"country"`
	Hostname string `json:"hostname"`
	Org      string `json:"org"`
}

func GetIPInfo

func GetIPInfo(ip net.IP, apiKey string) *IPInfo

Jump to

Keyboard shortcuts

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