location

package
v0.0.0-...-702564b Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type IPStack

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

func NewIPStack

func NewIPStack(log log.Logger, httpClient *http.Client) *IPStack

func (*IPStack) WhereAmI

func (i *IPStack) WhereAmI() (*Location, error)

type Location

type Location struct {
	CountryCode string  `json:"country_code"`
	RegionCode  string  `json:"region_code"`
	City        string  `json:"city"`
	Zip         string  `json:"zip"`
	Latitude    float64 `json:"latitude"`
	Longitude   float64 `json:"longitude"`
}

type Locator

type Locator interface {
	WhereAmI() (*Location, error)
}

Jump to

Keyboard shortcuts

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