place

package
v0.0.0-...-1591631 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGoogleAPIReportedProblem = herror.New("google api reported problem")
	ErrCouldNotFindAvgBusyData  = errors.New("could not find average busy data")
	ErrCouldNotFindCurBusyData  = errors.New("could not find current busy data")
)

Functions

This section is empty.

Types

type Google

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

func NewGoogle

func NewGoogle(apiKey string) (*Google, error)

func (*Google) FetchDetail

func (m *Google) FetchDetail(placeId PlaceId) *PlaceDetail

func (*Google) NearbySearch

func (m *Google) NearbySearch(lat, long float32, limit int) ([]*Place, error)

type Place

type Place struct {
	Id      PlaceId `json:"id"`
	Name    string  `json:"name"`
	Address string  `json:"address"`
}

type PlaceDetail

type PlaceDetail struct {
	Id        PlaceId   `json:"id"`
	Url       string    `json:"url"`
	Timestamp time.Time `json:"timestamp"`
	Lat       float32   `json:"lat"`
	Long      float32   `json:"long"`
	AvgBusy   int       `json:"average_busy,omitempty"`
	CurBusy   int       `json:"current_busy,omitempty"`
	Error     error     `json:"error,omitempty"`
}

type PlaceId

type PlaceId string

Jump to

Keyboard shortcuts

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