fy

package module
v0.0.0-...-337141b Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 9 Imported by: 0

README

Fy

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = New()

Functions

func FormatJSON

func FormatJSON(origin *Origin) string

func FormatMultiline

func FormatMultiline(origin *Origin) string

func FormatText

func FormatText(origin *Origin, trans *lang.Translate) string

func FormatXML

func FormatXML(origin *Origin) string

func InitASN

func InitASN() *maxminddb.Reader

func InitCity

func InitCity() *maxminddb.Reader

Types

type ASN

type ASN struct {
	ISPNumber       int    `maxminddb:"autonomous_system_number" json:"autonomous_system_number"`
	ISPOrganization string `maxminddb:"autonomous_system_organization" json:"autonomous_system_organization"`
	Name            string `json:"name"`
}

func LookupASN

func LookupASN(addr net.IP) (*ASN, error)

type City

type City struct {
	GeonameId int   `maxminddb:"geoname_id" json:"geoname_id"`
	Names     Names `maxminddb:"names" json:"names"`
}

type Continent

type Continent struct {
	Code      string `maxminddb:"code" json:"code"`
	GeonameId int    `maxminddb:"geoname_id" json:"geoname_id"`
	Names     Names  `maxminddb:"names" json:"names"`
}

type Country

type Country struct {
	IsoCode   string `maxminddb:"iso_code" json:"iso_code"`
	GeonameId int    `maxminddb:"geoname_id" json:"geoname_id"`
	Names     Names  `maxminddb:"names" json:"names"`
}

type FindYou

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

func New

func New() *FindYou

func (*FindYou) LookupASN

func (f *FindYou) LookupASN(ip net.IP, result interface{}) error

func (*FindYou) LookupCity

func (f *FindYou) LookupCity(ip net.IP, result interface{}) error

type GeoCity

type GeoCity struct {
	City              City              `maxminddb:"city" json:"city"`
	Continent         Continent         `maxminddb:"continent" json:"continent"`
	Location          Location          `maxminddb:"location" json:"location"`
	RegisteredCountry RegisteredCountry `maxminddb:"registered_country" json:"registered_country"`
	Country           Country           `maxminddb:"country" json:"country"`
	Subdivisions      []Subdivision     `maxminddb:"subdivisions" json:"subdivisions"`
}

func LookupCity

func LookupCity(addr net.IP) (*GeoCity, error)

type Location

type Location struct {
	Aadius    int     `maxminddb:"aadius" json:"aadius"`
	Latitude  float64 `maxminddb:"latitude" json:"latitude"`
	Longitude float64 `maxminddb:"longitude" json:"longitude"`
	TimeZone  string  `maxminddb:"time_zone" json:"time_zone"`
}

type Names

type Names map[string]string

type Origin

type Origin struct {
	Origin    string            `json:"origin"`
	Country   string            `json:"country"`
	Province  string            `json:"province"`
	City      string            `json:"city"`
	ASN       string            `json:"asn"`
	Longitude string            `json:"longitude"`
	Latitude  string            `json:"latitude"`
	Headers   map[string]string `json:"headers,omitempty" xml:"-"`
}

func LookupIP

func LookupIP(addr net.IP, lang string) *Origin

type RegisteredCountry

type RegisteredCountry struct {
	GeonameId int    `maxminddb:"geoname_id" json:"geoname_id"`
	IsoCode   string `maxminddb:"iso_code" json:"iso_code"`
	Names     Names  `maxminddb:"names" json:"names"`
}

type Subdivision

type Subdivision struct {
	GeonameId int    `maxminddb:"geoname_id" json:"geoname_id"`
	IsoCode   string `maxminddb:"iso_code" json:"iso_code"`
	Names     Names  `maxminddb:"names" json:"names"`
}

Directories

Path Synopsis
cmd
fy
internal

Jump to

Keyboard shortcuts

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