Documentation ¶
Overview ¶
Package places defines types for interacting with the Google Places API.
Index ¶
- type AccessibilityOptions
- type AddressComponent
- type AreaSummary
- type Attribution
- type AuthorAttribution
- type CachingService
- type ConnectorAggregation
- type ContentBlock
- type Date
- type EVChargeOptions
- type FuelOptions
- type FuelPrice
- type GenerativeSummary
- type LatLng
- type LocalizedText
- type Money
- type OpeningHours
- type ParkingOptions
- type PaymentOptions
- type Period
- type Photo
- type Place
- type Places
- type PlusCode
- type Point
- type RateLimitedService
- type RealService
- type References
- type Review
- type Service
- type SpecialDay
- type SubDestination
- type Viewport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessibilityOptions ¶
type AccessibilityOptions struct { WheelchairAccessibleEntrance bool `json:"wheelchairAccessibleEntrance,omitempty"` WheelchairAccessibleParking bool `json:"wheelchairAccessibleParking,omitempty"` WheelchairAccessibleRestroom bool `json:"wheelchairAccessibleRestroom,omitempty"` WheelchairAccessibleSeating bool `json:"wheelchairAccessibleSeating,omitempty"` }
type AddressComponent ¶
type AreaSummary ¶
type AreaSummary struct {
ContentBlocks []*ContentBlock `json:"contentBlocks,omitempty"`
}
type Attribution ¶
type AuthorAttribution ¶
type CachingService ¶
type CachingService struct {
// contains filtered or unexported fields
}
CachingService is a Service that permanently caches place lookups in a bolt database.
func NewCachingService ¶
func NewCachingService(filename string, next Service) (*CachingService, error)
NewCachingService creates a new CachingService that "wraps" the given Service and caches lookups in the given filename.
func (*CachingService) Close ¶
func (s *CachingService) Close() error
Close closes the cache database.
type ConnectorAggregation ¶
type ConnectorAggregation struct { AvailabilityLastUpdateTime string `json:"availabilityLastUpdateTime,omitempty"` AvailableCount int64 `json:"availableCount,omitempty"` Count int64 `json:"count,omitempty"` MaxChargeRateKW float64 `json:"maxChargeRateKw,omitempty"` OutOfServiceCount int64 `json:"outOfServiceCount,omitempty"` Type string `json:"type,omitempty"` }
type ContentBlock ¶
type ContentBlock struct { Content *LocalizedText `json:"content,omitempty"` References *Places `json:"references,omitempty"` Topic string `json:"topic,omitempty"` }
type EVChargeOptions ¶
type EVChargeOptions struct { ConnectorAggregation []*ConnectorAggregation `json:"connectorAggregation,omitempty"` ConnectorCount int64 `json:"connectorCount,omitempty"` }
type FuelOptions ¶
type FuelOptions struct {
FuelPrices []*FuelPrice `json:"fuelPrices,omitempty"`
}
type GenerativeSummary ¶
type GenerativeSummary struct { Description *LocalizedText `json:"description,omitempty"` Overview *LocalizedText `json:"overview,omitempty"` References *References `json:"references,omitempty"` }
type LocalizedText ¶
type OpeningHours ¶
type OpeningHours struct { OpenNow bool `json:"openNow,omitempty"` Periods []*Period `json:"periods,omitempty"` SecondaryHoursType string `json:"secondaryHoursType,omitempty"` SpecialDays []SpecialDay `json:"specialDays,omitempty"` WeekdayDescriptions []string `json:"weekdayDescriptions,omitempty"` }
type ParkingOptions ¶
type PaymentOptions ¶
type Photo ¶
type Photo struct { AuthorAttributions []*AuthorAttribution `json:"authorAttributions,omitempty"` HeightPx int64 `json:"heightPx,omitempty"` Name string `json:"name,omitempty"` WidthPx int64 `json:"widthPx,omitempty"` }
type Place ¶
type Place struct { AccessibilityOptions *AccessibilityOptions `json:"accessibilityOptions,omitempty"` AddressComponents []*AddressComponent `json:"addressComponents,omitempty"` AdrFormatAddress string `json:"adrFormatAddress,omitempty"` AllowsDogs bool `json:"allowsDogs,omitempty"` AreaSummary *AreaSummary `json:"areaSummary,omitempty"` Attributions []*Attribution `json:"attributions,omitempty"` BusinessStatus string `json:"businessStatus,omitempty"` CurbsidePickup bool `json:"curbsidePickup,omitempty"` CurrentOpeningHours *OpeningHours `json:"currentOpeningHours,omitempty"` CurrentSecondaryOpeningHours []*OpeningHours `json:"currentSecondaryOpeningHours,omitempty"` Delivery bool `json:"delivery,omitempty"` DineIn bool `json:"dineIn,omitempty"` DisplayName *LocalizedText `json:"displayName,omitempty"` EditorialSummary *LocalizedText `json:"editorialSummary,omitempty"` EVChargeOptions *EVChargeOptions `json:"evChargeOptions,omitempty"` FormattedAddress string `json:"formattedAddress,omitempty"` FuelOptions *FuelOptions `json:"fuelOptions,omitempty"` GenerativeSummary *GenerativeSummary `json:"generativeSummary,omitempty"` GoodForChildren bool `json:"goodForChildren,omitempty"` GoodForGroups bool `json:"goodForGroups,omitempty"` GoodForWatchingSports bool `json:"goodForWatchingSports,omitempty"` GoogleMapsURI string `json:"googleMapsUri,omitempty"` IconBackgroundColor string `json:"iconBackgroundColor,omitempty"` IconMaskBaseURI string `json:"iconMaskBaseUri,omitempty"` ID string `json:"id,omitempty"` InternationalPhoneNumber string `json:"internationalPhoneNumber,omitempty"` LiveMusic bool `json:"liveMusic,omitempty"` Location *LatLng `json:"location,omitempty"` MenuForChildren bool `json:"menuForChildren,omitempty"` Name string `json:"name,omitempty"` NationalPhoneNumber string `json:"nationalPhoneNumber,omitempty"` OutdoorSeating bool `json:"outdoorSeating,omitempty"` ParkingOptions *ParkingOptions `json:"parkingOptions,omitempty"` PaymentOptions *PaymentOptions `json:"paymentOptions,omitempty"` Photos []*Photo `json:"photos,omitempty"` PlusCode *PlusCode `json:"plusCode,omitempty"` PriceLevel string `json:"priceLevel,omitempty"` PrimaryType string `json:"primaryType,omitempty"` PrimaryTypeDisplayName *LocalizedText `json:"primaryTypeDisplayName,omitempty"` Rating float64 `json:"rating,omitempty"` RegularOpeningHours *OpeningHours `json:"regularOpeningHours,omitempty"` RegularSecondaryOpeningHours []*OpeningHours `json:"regularSecondaryOpeningHours,omitempty"` Reservable bool `json:"reservable,omitempty"` Restroom bool `json:"restroom,omitempty"` Reviews []*Review `json:"reviews,omitempty"` ServesBeer bool `json:"servesBeer,omitempty"` ServesBreakfast bool `json:"servesBreakfast,omitempty"` ServesBrunch bool `json:"servesBrunch,omitempty"` ServesCocktails bool `json:"servesCocktails,omitempty"` ServesCoffee bool `json:"servesCoffee,omitempty"` ServesDessert bool `json:"servesDessert,omitempty"` ServesDinner bool `json:"servesDinner,omitempty"` ServesLunch bool `json:"servesLunch,omitempty"` ServesVegetarianFood bool `json:"servesVegetarianFood,omitempty"` ServesWine bool `json:"servesWine,omitempty"` ShortFormattedAddress string `json:"shortFormattedAddress,omitempty"` SubDestinations []*SubDestination `json:"subDestinations,omitempty"` Takeout bool `json:"takeout,omitempty"` Types []string `json:"types,omitempty"` UserRatingCount int64 `json:"userRatingCount,omitempty"` UtcOffsetMinutes int64 `json:"utcOffsetMinutes,omitempty"` Viewport *Viewport `json:"viewport,omitempty"` WebsiteURI string `json:"websiteUri,omitempty"` }
Place is a Google Places API place. This data type was generated by github.com/bobg/gjtypes, supplemented by information at https://developers.google.com/maps/documentation/places/web-service/reference/rest/v1/places.
type RateLimitedService ¶
type RateLimitedService struct {
// contains filtered or unexported fields
}
RateLimitedService is a Service that limits the rate at which it calls another Service.
func NewRateLimitedService ¶
func NewRateLimitedService(limit rate.Limit, next Service) *RateLimitedService
NewRateLimitedService creates a new RateLimitedService that "wraps" the given Service and limits the rate at which it calls it.
type RealService ¶
type RealService struct {
// contains filtered or unexported fields
}
RealService is an implementation of Service that talks to the Google Places API.
func NewRealService ¶
NewRealService creates a new RealService. It reads the Google API credentials from creds, and the OAuth token from tokenFile. If there is no valid token in tokenFile, it will open the user's browser to obtain one and write it to the file.
type References ¶
type Review ¶
type Review struct { AuthorAttribution *AuthorAttribution `json:"authorAttribution,omitempty"` Name string `json:"name,omitempty"` OriginalText *LocalizedText `json:"originalText,omitempty"` PublishTime string `json:"publishTime,omitempty"` Rating int64 `json:"rating,omitempty"` RelativePublishTimeDescription string `json:"relativePublishTimeDescription,omitempty"` Text *LocalizedText `json:"text,omitempty"` }
type SpecialDay ¶
type SpecialDay struct {
Date *Date `json:"date,omitempty"`
}