v1

package
v0.0.0-...-b0ce203 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2021 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type City

type City struct {
	Name   string `json:"name"`
	Region Region `json:"region"`
}

type Country

type Country struct {
	Name                   string `json:"name"`
	Alpha_2                string `json:"alpha-2"`
	Alpha_3                string `json:"alpha-3"`
	CountryCode            string `json:"country-code"`
	ISO_3166_2             string `json:"iso31662"`
	Region                 string `json:"region"`
	SubRegion              string `json:"sub-region"`
	IntermediateRegion     string `json:"intermediate-region"`
	RegionCode             string `json:"region-code"`
	SubRegionCode          string `json:"sub-region-code"`
	IntermediateRegionCode string `json:"intermediate-region-code"`
	CustomCode             string `json:"custom-code"`
}

type Location

type Location struct {
	City City `json:"city"`
}

func (*Location) GetCountry

func (location *Location) GetCountry() (*Country, error)

func (*Location) GetRegion

func (location *Location) GetRegion() (*Region, error)

func (*Location) IsLocatingInCity

func (location *Location) IsLocatingInCity(city *City) (bool, error)

func (*Location) IsLocatingInCountry

func (location *Location) IsLocatingInCountry(country *Country) (bool, error)

func (*Location) IsLocatingInRegion

func (location *Location) IsLocatingInRegion(region *Region) (bool, error)

type Region

type Region struct {
	Name    string  `json:"name"`
	Code    string  `json:"code"`
	Country Country `json:"country"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL