mirror of
https://github.com/dcarrillo/whatismyip.git
synced 2025-07-01 22:09:26 +00:00
Add CI and go-report badges. Add comments to make golint happy
This commit is contained in:
@ -7,10 +7,12 @@ import (
|
||||
"github.com/dcarrillo/whatismyip/models"
|
||||
)
|
||||
|
||||
// Geo defines a base type for lookups
|
||||
type Geo struct {
|
||||
IP net.IP
|
||||
}
|
||||
|
||||
// LookUpCity queries the database for city data related to the given IP
|
||||
func (g *Geo) LookUpCity() *models.GeoRecord {
|
||||
record := &models.GeoRecord{}
|
||||
err := record.LookUp(g.IP)
|
||||
@ -22,6 +24,7 @@ func (g *Geo) LookUpCity() *models.GeoRecord {
|
||||
return record
|
||||
}
|
||||
|
||||
// LookUpASN queries the database for ASN data related to the given IP
|
||||
func (g *Geo) LookUpASN() *models.ASNRecord {
|
||||
record := &models.ASNRecord{}
|
||||
err := record.LookUp(g.IP)
|
||||
|
Reference in New Issue
Block a user