Documentation
¶
Overview ¶
Package geo provides geo-location utilities for AppEngine
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Location ¶
type Location struct {
Country string `datastore:"country"` // ISO 3166-1 alpha-2 country code (e.g., "US")
Region string `datastore:"region"` // Region/state (e.g., "ca" for California)
City string `datastore:"city"` // City name
CityLatLong string `datastore:"city_latlong"` // Latitude,longitude
DetectedAt time.Time `datastore:"detected_at"` // When this location was detected
DetectedFrom string `datastore:"detected_from"` // "session" or "signup"
}
Location represents geographic information from AppEngine headers
func ExtractFromRequest ¶
ExtractFromRequest extracts geo-location from AppEngine headers AppEngine automatically adds these headers based on the client's IP address
func (*Location) GetCountryName ¶
GetCountryName returns a human-readable country name This is a simple implementation - for production you may want a full lookup table
func (*Location) GetDisplayString ¶
GetDisplayString returns a formatted location string for display
Click to show internal directories.
Click to hide internal directories.