places

package
Version: v0.0.0-...-b472bfd Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package places is providing support to query the Google maps places API and retrieve places for a specified city. https://developers.google.com/places/web-service/intro

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Name    string  `json:"name"`
	Lat     float64 `json:"lat"`
	Lng     float64 `json:"lng"`
	Keyword string
	Radius  uint
	// contains filtered or unexported fields
}

Filter defines the specific places to filter out.

type NearbySearcher

type NearbySearcher interface {
	NearbySearch(ctx context.Context, r *maps.NearbySearchRequest) (maps.PlacesSearchResponse, error)
}

NearbySearcher defines behavior for performing map searches.

type Place

type Place struct {
	PlaceID          string   `json:"place_id"`
	CityName         string   `json:"city_name"`
	Name             string   `json:"name"`
	Address          string   `json:"address"`
	Lat              float64  `json:"lat"`
	Lng              float64  `json:"lng"`
	LocationType     []string `json:"location_type"`
	AvgUserRating    float32  `json:"avg_user_rating"`
	NumberOfRatings  int      `json:"no_user_rating"`
	GmapsURL         string   `json:"gmaps_url"`
	PhotoReferenceID string   `json:"photo_id"`
}

Place contains the place data points captured from the API.

func Search(ctx context.Context, client NearbySearcher, filter *Filter) ([]Place, error)

Search finds places for the specified search criteria.

Source Files

Jump to

Keyboard shortcuts

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