Documentation
¶
Index ¶
- func AssetKey(uri string) *datastore.Key
- func Close()
- func CreateAsset(ctx context.Context, as *api.Asset) (string, error)
- func CreateGeoLocation(ctx context.Context, ip string) error
- func CreateMeasurement(ctx context.Context, m *types.MeasurementDS) error
- func GeoLocationKey(ip string) *datastore.Key
- func GetAsset(ctx context.Context, uri string) (*api.Asset, error)
- type LocationType
- type LookupResult
- type ResultsType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAsset ¶
CreateAsset stores an asset in the Datastore
func CreateGeoLocation ¶
CreateGeoLocation looks up the IP's geolocation if it is unknown
func CreateMeasurement ¶
func CreateMeasurement(ctx context.Context, m *types.MeasurementDS) error
CreateMeasurement records a link activation
func GeoLocationKey ¶
GeoLocationKey creates the datastore key for a geolocation
Types ¶
type LocationType ¶
type LocationType struct { Text string `xml:",chardata"` IP string `xml:"ip"` Host string `xml:"host"` Isp string `xml:"isp"` City string `xml:"city"` Countrycode string `xml:"countrycode"` Countryname string `xml:"countryname"` Latitude string `xml:"latitude"` Longitude string `xml:"longitude"` }
LocationType holds the geo data
func (*LocationType) AsInternal ¶
func (r *LocationType) AsInternal() *types.GeoLocationDS
AsInternal converts the geolocation into the internal DS struct
type LookupResult ¶
type LookupResult struct { XMLName xml.Name `xml:"ip"` Text string `xml:",chardata"` Results ResultsType `xml:"results"` }
LookupResult is the struct returned by a lookup on geoiplookup.net
type ResultsType ¶
type ResultsType struct { XMLName xml.Name `xml:"results"` Text string `xml:",chardata"` Result LocationType `xml:"result"` }
ResultsType container for the location
Click to show internal directories.
Click to hide internal directories.