meander

package
v0.0.0-...-63c9371 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIKey string

APIKey is the Google Places API key that will be used to make requests to the service.

View Source
var Journeys = []interface{}{
	j{Name: "a romantic day", PlaceTypes: []string{"park", "bar", "movie_theatre", "restaurant", "florist", "taxi_stand"}},
	j{Name: "a shopping spree", PlaceTypes: []string{"department_store", "cafe", "clothing_store", "jewelry_store", "shoe_store"}},
	j{Name: "a night out", PlaceTypes: []string{"bar", "casino", "food", "bar", "night_club", "bar", "bar", "hospital"}},
	j{Name: "a culture day", PlaceTypes: []string{"museum", "cafe", "cemetery", "library", "art_gallery"}},
	j{Name: "a pamper day", PlaceTypes: []string{"hair_care", "beauty_salon", "cafe", "spa"}},
}

Journeys represents the pre-set journeys data.

Functions

func Public

func Public(o interface{}) interface{}

Public gets the public representation of the specified object if it implements the Facade interface. Otherwise returns the object untouched.

Types

type Cost

type Cost int8

Cost represents a cost level.

const (
	Cost1 Cost
	Cost2
	Cost3
	Cost4
	Cost5
)

Cost enumerator represents various levels of Cost.

func ParseCost

func ParseCost(s string) Cost

ParseCost parses the cost string into a Cost type.

func (Cost) String

func (l Cost) String() string

type CostRange

type CostRange struct {
	From Cost
	To   Cost
}

CostRange represents a range of Cost values.

func ParseCostRange

func ParseCostRange(s string) (CostRange, error)

ParseCostRange parses a cost range string into a CostRange.

func (CostRange) String

func (r CostRange) String() string

type Facade

type Facade interface {
	Public() interface{}
}

Facade represents objects that provide a public view of themselves.

type Place

type Place struct {
	Name     string         `json:"name"`
	Icon     string         `json:"icon"`
	Photos   []*googlePhoto `json:"photos"`
	Vicinity string         `json:"vicinity"`
	// contains filtered or unexported fields
}

Place represents a single place.

func (*Place) Public

func (p *Place) Public() interface{}

Public gets a public view of a Place.

type Query

type Query struct {
	Lat          float64
	Lng          float64
	Journey      []string
	Radius       int
	CostRangeStr string
}

Query represents a runnable Query against the Google Places API.

func (*Query) Run

func (q *Query) Run() []interface{}

Run runs the query concurrently, and returns the results.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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