ports

package
v0.0.0-...-d894bde Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN

type ASN struct {
	Number       uint   `json:"number"`
	Organization string `json:"organization"`
}

type City

type City struct {
	Latitude  float32 `json:"latitude"`
	Longitude float32 `json:"longitude"`
	TimeZone  string  `json:"time_zone"`
}

type Continent

type Continent struct {
	Code string `json:"code"`
	Name string `json:"name"`
}

type Country

type Country struct {
	ISOCode string `json:"iso_code"`
	Name    string `json:"name"`
}

type IIPInfo

type IIPInfo interface {
	Info(ip net.IP, continent bool, country bool, city bool, asn bool) (Info, error)
	ShortInfo(ip net.IP) (ShortInfo, error)
}

type IMaxMind

type IMaxMind interface {
	GetContinent(ip net.IP) (Continent, error)
	GetCountry(ip net.IP) (Country, error)
	GetCity(ip net.IP) (City, error)
	GetASN(ip net.IP) (ASN, error)
	Load(countryReader *maxminddb.Reader, cityReader *maxminddb.Reader, asnReader *maxminddb.Reader)
}

type Info

type Info struct {
	IP        string     `json:"ip"`
	Continent *Continent `json:"continent,omitempty"`
	Country   *Country   `json:"country,omitempty"`
	City      *City      `json:"city,omitempty"`
	ASN       *ASN       `json:"asn,omitempty"`
}

type ShortInfo

type ShortInfo struct {
	IP           string `json:"ip"`
	Country      string `json:"country"`
	Continent    string `json:"continent"`
	Location     string `json:"location"`
	Organization string `json:"org"`
	TimeZone     string `json:"time_zone"`
}

Jump to

Keyboard shortcuts

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