geo

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package geo parses and returns a geonames.org geolocation data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Geo

type Geo struct {
	// contains filtered or unexported fields
}

Geo is the geolocation controller.

func New

func New(filePath string) (*Geo, error)

New initiates a new geo location map.

func (*Geo) Count

func (g *Geo) Count() int

Count returns the number of unique locations loaded.

func (*Geo) Query

func (g *Geo) Query(q string) []Location

Query queries a loaded geo location by the given keyword.

type Location

type Location struct {
	ID         string
	Name       string
	Lat        float64
	Lon        float64
	Timezone   string
	Country    string
	Population int

	Loc *time.Location
}

Location represents a geographic location.

Jump to

Keyboard shortcuts

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