Documentation
¶
Index ¶
- type City
- type Country
- type DBTX
- type GetCityLatLongParams
- type GetCityLatLongRow
- type GetStateCodeParams
- type LatLong
- type LocationService
- type Queries
- func (q *Queries) GetCityLatLong(ctx context.Context, arg GetCityLatLongParams) (GetCityLatLongRow, error)
- func (q *Queries) GetCountryCode(ctx context.Context, name string) (sql.NullString, error)
- func (q *Queries) GetStateCode(ctx context.Context, arg GetStateCodeParams) (sql.NullString, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type Region
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type City ¶
type City struct {
ID int64 `json:"id"`
Name string `json:"name"`
StateID int64 `json:"state_id"`
StateCode string `json:"state_code"`
CountryID int64 `json:"country_id"`
CountryCode string `json:"country_code"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Flag int64 `json:"flag"`
WikiDataId sql.NullString `json:"wikiDataId"`
}
type Country ¶
type Country struct {
ID int64 `json:"id"`
Name string `json:"name"`
Iso3 sql.NullString `json:"iso3"`
NumericCode sql.NullString `json:"numeric_code"`
Iso2 sql.NullString `json:"iso2"`
Phonecode sql.NullString `json:"phonecode"`
Capital sql.NullString `json:"capital"`
Currency sql.NullString `json:"currency"`
CurrencyName sql.NullString `json:"currency_name"`
CurrencySymbol sql.NullString `json:"currency_symbol"`
Tld sql.NullString `json:"tld"`
Native sql.NullString `json:"native"`
Region sql.NullString `json:"region"`
RegionID sql.NullInt64 `json:"region_id"`
Subregion sql.NullString `json:"subregion"`
SubregionID sql.NullInt64 `json:"subregion_id"`
Nationality sql.NullString `json:"nationality"`
Timezones sql.NullString `json:"timezones"`
Translations sql.NullString `json:"translations"`
Latitude sql.NullFloat64 `json:"latitude"`
Longitude sql.NullFloat64 `json:"longitude"`
Emoji sql.NullString `json:"emoji"`
EmojiU sql.NullString `json:"emojiU"`
CreatedAt sql.NullTime `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Flag int64 `json:"flag"`
WikiDataId sql.NullString `json:"wikiDataId"`
}
type GetCityLatLongParams ¶
type GetCityLatLongRow ¶
type GetStateCodeParams ¶
type LocationService ¶
type LocationService struct {
// contains filtered or unexported fields
}
LocationService provides location lookup functionality
func NewLocationService ¶
func NewLocationService() (*LocationService, error)
NewLocationService creates a new location service with embedded databases
func (*LocationService) Close ¶
func (ls *LocationService) Close() error
Close closes all database connections and cleans up temporary files
func (*LocationService) GetLatLong ¶
func (ls *LocationService) GetLatLong(ctx context.Context, city, state, country string) (*LatLong, error)
GetLatLong retrieves latitude and longitude for a given city, state, and country
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) GetCityLatLong ¶
func (q *Queries) GetCityLatLong(ctx context.Context, arg GetCityLatLongParams) (GetCityLatLongRow, error)
func (*Queries) GetCountryCode ¶
func (*Queries) GetStateCode ¶
func (q *Queries) GetStateCode(ctx context.Context, arg GetStateCodeParams) (sql.NullString, error)
type State ¶
type State struct {
ID int64 `json:"id"`
Name string `json:"name"`
CountryID int64 `json:"country_id"`
CountryCode string `json:"country_code"`
FipsCode sql.NullString `json:"fips_code"`
Iso2 sql.NullString `json:"iso2"`
Type sql.NullString `json:"type"`
Level sql.NullInt64 `json:"level"`
ParentID sql.NullInt64 `json:"parent_id"`
Native sql.NullString `json:"native"`
Latitude sql.NullFloat64 `json:"latitude"`
Longitude sql.NullFloat64 `json:"longitude"`
CreatedAt sql.NullTime `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Flag int64 `json:"flag"`
WikiDataId sql.NullString `json:"wikiDataId"`
}
Click to show internal directories.
Click to hide internal directories.