coordinate

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCity

func GetCity(ip net.IP) (*geoip2.City, error)

func GetCountry

func GetCountry(ip net.IP) (*geoip2.Country, error)

func PointInRange

func PointInRange(point Coordinate, area Range) bool

Types

type Coordinate

type Coordinate struct {
	Longitude float64 `json:"longitude"` // -180 ~ 0 ~ 180
	Latitude  float64 `json:"latitude"`  // -90 ~ 0 ~ 90
}

type Range

type Range struct {
	Coordinate []Coordinate `json:"coordinate"`
}

func ConvertToRange

func ConvertToRange(longitude, latitude []string) (Range, error)

Jump to

Keyboard shortcuts

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