Add CI and go-report badges. Add comments to make golint happy

This commit is contained in:
2021-11-30 17:21:01 +01:00
parent 9b10052cd1
commit 2d330a99b7
8 changed files with 24 additions and 2 deletions

View File

@ -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)