maps

package
v0.0.0-...-7265847 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func DialGoogle

func DialGoogle(key string, timeout time.Duration, maxRPS, limit int) (*API, error)

Dial connects to the google maps client, specifying a timeout for all DB operations and a max number of operations running concurrently.

func (*API) Get

func (api *API) Get(txn newrelic.Transaction, placeID string) <-chan PlacesResult

Get asynchronously fetches information about a place.

func (*API) NearbySearch

func (api *API) NearbySearch(txn newrelic.Transaction, lat, lng float64, radius uint) <-chan PlacesResult

NearbySearch asynchronously sends a nearby search request to google maps and streams back its resources.

type Place

type Place struct {
	Name        string
	Lat         float64
	Lng         float64
	ID          string
	Types       []string
	Website     string
	Icon        string
	Address     string
	PhoneNumber string
}

type PlacesResult

type PlacesResult struct {
	Results []*Place
	Error   error
}

Jump to

Keyboard shortcuts

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