geo

package
v0.0.0-...-d1236c8 Latest Latest
Warning

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

Go to latest
Published: May 7, 2016 License: BSD-3-Clause Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorPartialMatch will be used when the geocoder API responds with a partial
	// match. In this case, the received location will still be included in the
	// return values, so the client can decide whether to continue or not.
	ErrorPartialMatch = errors.New("Geocoder returned a partial match.")
)

Functions

This section is empty.

Types

type Coder

type Coder interface {
	Code(address string) (Location, error)
	CodeForRegion(address, region string) (Location, error)
}

Coder is an object that knows how to geocode an address

func NewCoder

func NewCoder(conf *Config) Coder

type Config

type Config struct {
	APIKey string
}

func NewConfig

func NewConfig() *Config

type Location

type Location struct {
	Lat float64 `json:"lat"`
	Lng float64 `json:"lng"`
}

Location defines a geographical coordinate

Jump to

Keyboard shortcuts

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