Documentation
¶
Overview ¶
Package citygraph contains code for interacting with the Torontoverse.
Index ¶
- Variables
- func FloatVal(num float64) *pb.Json
- func IntVal(num int) *pb.Json
- func Json(b []byte) *pb.Json
- func LngLatVal(loc LngLat) *pb.Json
- func MustParseUUIDBytes(id string) []byte
- func NewEdgePropertyQuery(inner *pb.EdgeQuery, name string) *pb.EdgePropertyQuery
- func NewID() uuid.UUID
- func NewPipeEdgeQuery(inner *pb.VertexQuery, dir pb.EdgeDirection, t *pb.Identifier) *pb.EdgeQuery
- func NewPipeEdgeQueryLimit(inner *pb.VertexQuery, dir pb.EdgeDirection, t *pb.Identifier, limit int) *pb.EdgeQuery
- func NewPipeEdgeQueryLimitOffset(inner *pb.VertexQuery, dir pb.EdgeDirection, t *pb.Identifier, limit int, ...) *pb.EdgeQuery
- func NewPipeVertexQuery(inner *pb.EdgeQuery, dir pb.EdgeDirection, t *pb.Identifier) *pb.VertexQuery
- func NewSpecificEdgeQuery(keys ...*pb.EdgeKey) *pb.EdgeQuery
- func NewSpecificVertexQuery(ids ...*pb.Uuid) *pb.VertexQuery
- func NewVertexPropertyQuery(inner *pb.VertexQuery, name string) *pb.VertexPropertyQuery
- func SetEdgePropertiesRequest(inner *pb.EdgeQuery, name string, jsonValue interface{}) (*pb.SetEdgePropertiesRequest, error)
- func SetVertexPropertiesRequest(inner *pb.VertexQuery, name string, jsonValue interface{}) (*pb.SetVertexPropertiesRequest, error)
- func StringVal(str string) *pb.Json
- func UUID(id uuid.UUID) *pb.Uuid
- type Article
- func (a *Article) AllSlugTitles() (slugs []string)
- func (a *Article) LoadBodyText() (string, error)
- func (a *Article) Path() (string, error)
- func (a *Article) SlugID() (string, error)
- func (a *Article) SlugTitle() string
- func (a *Article) UUID() (uuid.UUID, error)
- func (a *Article) VertexQuery() (*pb.VertexQuery, error)
- type Bar
- type BulkSender
- type Cafe
- type Client
- func (c *Client) CreateEdge(ctx context.Context, outbound *pb.Uuid, t *pb.Identifier, inbound *pb.Uuid) error
- func (c *Client) CreateVertex(ctx context.Context, id *pb.Uuid, t *pb.Identifier) error
- func (c *Client) CreateVertexFromType(ctx context.Context, t *pb.Identifier) (*pb.Uuid, error)
- func (c *Client) DeleteEdges(ctx context.Context, query *pb.EdgeQuery) error
- func (c *Client) DeleteVertices(ctx context.Context, query *pb.VertexQuery) error
- func (c *Client) GetAllEdgeProperties(ctx context.Context, query *pb.EdgeQuery) ([]*pb.EdgeProperties, error)
- func (c *Client) GetAllVertexProperties(ctx context.Context, query *pb.VertexQuery) ([]*pb.VertexProperties, error)
- func (c *Client) GetEdgeProperties(ctx context.Context, query *pb.EdgeQuery, name string) ([]*pb.EdgeProperty, error)
- func (c *Client) GetEdges(ctx context.Context, query *pb.EdgeQuery) ([]*pb.Edge, error)
- func (c *Client) GetVertexProperties(ctx context.Context, query *pb.VertexQuery, name string) ([]*pb.VertexProperty, error)
- func (c *Client) GetVertices(ctx context.Context, query *pb.VertexQuery) ([]*pb.Vertex, error)
- func (c *Client) NewBulkSender(ctx context.Context) (BulkSender, error)
- func (c *Client) SetEdgeProperties(ctx context.Context, query *pb.EdgeQuery, name string, jsonValue interface{}) error
- func (c *Client) SetVertexProperties(ctx context.Context, query *pb.VertexQuery, name string, jsonValue interface{}) error
- type Duration
- type FakeGraphClient
- func (f *FakeGraphClient) CreateEdge(ctx context.Context, outbound *pb.Uuid, t *pb.Identifier, inbound *pb.Uuid) error
- func (f *FakeGraphClient) CreateVertex(ctx context.Context, id *pb.Uuid, t *pb.Identifier) error
- func (f *FakeGraphClient) CreateVertexFromType(ctx context.Context, t *pb.Identifier) (*pb.Uuid, error)
- func (f *FakeGraphClient) DeleteEdges(ctx context.Context, query *pb.EdgeQuery) error
- func (c *FakeGraphClient) DeleteVertices(ctx context.Context, query *pb.VertexQuery) error
- func (f *FakeGraphClient) GetAllEdgeProperties(ctx context.Context, query *pb.EdgeQuery) ([]*pb.EdgeProperties, error)
- func (f *FakeGraphClient) GetAllVertexProperties(ctx context.Context, query *pb.VertexQuery) ([]*pb.VertexProperties, error)
- func (f *FakeGraphClient) GetEdgeProperties(ctx context.Context, query *pb.EdgeQuery, name string) ([]*pb.EdgeProperty, error)
- func (f *FakeGraphClient) GetEdges(ctx context.Context, query *pb.EdgeQuery) ([]*pb.Edge, error)
- func (f *FakeGraphClient) GetVertexProperties(ctx context.Context, query *pb.VertexQuery, name string) ([]*pb.VertexProperty, error)
- func (f *FakeGraphClient) GetVertices(ctx context.Context, query *pb.VertexQuery) ([]*pb.Vertex, error)
- func (f *FakeGraphClient) NewBulkSender(ctx context.Context) (BulkSender, error)
- func (f *FakeGraphClient) SetEdgeProperties(ctx context.Context, query *pb.EdgeQuery, name string, jsonValue interface{}) error
- func (f *FakeGraphClient) SetVertexProperties(ctx context.Context, query *pb.VertexQuery, name string, jsonValue interface{}) error
- type GeoJSONDataset
- type GraphClient
- type Image
- type LngLat
- type Module
- type Place
- type PlaceLocation
- type Restaurant
- type Source
Constants ¶
This section is empty.
Variables ¶
var ( ArticleType = &pb.Identifier{Value: "news-contributor-article"} IsRelated = pb.Identifier{Value: "is-related"} )
var ( // PropertyNameDisplayName identifies the name for this vertex that should // be displayed when thnis vertex is viewed. If this data is meaningful, it // should be duplicated in another property with a more descriptive name. PropertyNameDisplayName = "display_name" PropertyNameUpdatedAt = "updated_at" )
var ( PropertyNameBodyText = "body" // PropertyNameBodyTextFormat identifies the format for the module's display, default is // "content-flex" but also possible in "content-map". PropertyNameFormat = "format" // PropertyNameImgURL identifies a property containing a URL pointing at an // image that should be used for promotion, eg. OpenGraph, feed entries, etc. PropertyNameImgURL = "img_url" PropertyNameJSFunc = "javascript_function" )
var ( // PropertyNameGeoJSONFeature identifies a property containing a GeoJSON // feature or feature collection object. PropertyNameGeoJSONFeature = "geojson_feature" // PropertyNameGeoJSONShape identifies a property containing GeoJSON // compatible geometry that can be included in a feature or feature // collection object. PropertyNameGeoJSONShape = "geojson_shape" // PropertyNameGeoJSONURL identifies a property containing a URL string // pointing at a location that will return a valid GeoJSON feature or // feeature collection. PropertyNameGeoJSONURL = "geojson_url" )
GeoJSON property names.
var ( // CityPrimary identifies a city that is the biggest in its geographic area // like Toronto, London or Stockholm. CityPrimary = pb.Identifier{Value: "city-primary"} // CityIntersection identifies an intersection inside a city. CityIntersection = pb.Identifier{Value: "city-intersection"} // CityNeighbourhood identifies an neighbourhood inside a city. CityNeighbourhood = pb.Identifier{Value: "city-neighbourhood"} // CityMayorOffice identifies the mayor's office of a city but not any // particular mayor individually. CityMayorOffice = pb.Identifier{Value: "city-mayor-office"} // CityWard identifies a Ward, a typical city constituency. CityWard = pb.Identifier{Value: "city-ward"} // A waterfront recreation location that may or may not feature sand. Beach = pb.Identifier{Value: "beach"} )
var ( //HasOffice points from a municipality to offices it maintains, like mayor. HasOffice = pb.Identifier{Value: "has-office"} //HasConstituency points from a municipality to it's electoral constituencies. HasConstituency = pb.Identifier{Value: "has-constituency"} )
var ( MarieCurtisParkEastBeach = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6ed8-ffc1-11eb-b867-244bfe5bf61a"), }, T: &Beach, } SunnysideBeach = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6ec1-ffc1-11eb-b867-244bfe5bf61a"), }, T: &Beach, } HanlansPointBeach = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6ea4-ffc1-11eb-b867-244bfe5bf61a"), }, T: &Beach, } GibraltarPointBeach = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6e96-ffc1-11eb-b867-244bfe5bf61a"), }, T: &Beach, } CentreIslandBeach = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6e78-ffc1-11eb-b867-244bfe5bf61a"), }, T: &Beach, } WardsIslandBeach = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6e50-ffc1-11eb-b867-244bfe5bf61a"), }, T: &Beach, } CherryBeach = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6e44-ffc1-11eb-b867-244bfe5bf61a"), }, T: &Beach, } WoodbineBeaches = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6e2d-ffc1-11eb-b867-244bfe5bf61a"), }, T: &Beach, } KewBalmyBeach = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6e18-ffc1-11eb-b867-244bfe5bf61a"), }, T: &Beach, } BluffersParkBeach = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6db6-ffc1-11eb-b867-244bfe5bf61a"), }, T: &Beach, } )
Toronto Beaches
var ( // Vertex types NewsPublisher = pb.Identifier{Value: "news-publisher"} NewsArticle = pb.Identifier{Value: "news-article"} NewsWireArticle = pb.Identifier{Value: "news-wire-article"} NewsWireBulletin = pb.Identifier{Value: "news-wire-bulletin"} NewsAuthor = pb.Identifier{Value: "news-author"} NewsCategory = pb.Identifier{Value: "news-category"} NewsImage = pb.Identifier{Value: "news-image"} NewsGeoJSON = pb.Identifier{Value: "news-geojson"} // Edge types Published = pb.Identifier{Value: "published"} // author or publisher -> publish -> item. PublishedBy = pb.Identifier{Value: "published-by"} // item -> published by -> author or publisher PublishesAbout = pb.Identifier{Value: "publishes-about"} // item or publisher -> about -> a category. ItemAbout = pb.Identifier{Value: "item-about"} // item or publisher -> about -> a category. IllustratedBy = pb.Identifier{Value: "illustrated-by"} CoversTopic = pb.Identifier{Value: "covers-topic"} Featuring = pb.Identifier{Value: "featuring"} )
News Types
var ( PlaceType = pb.Identifier{Value: "poi"} HasOtherLocation = &pb.Identifier{Value: "has-other-location"} )
var ModuleType = &pb.Identifier{Value: "module"}
var ( // PropertyNameSource identifies a property containing a source object // that describes the provider or the dataset and the license under which // it is being used. PropertyNameSource = "source" )
Dataset property names.
var ( Toronto = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6bc0-ffc1-11eb-b867-244bfe5bf61a"), }, T: &CityPrimary, } )
Municipal anchor vertices
var ( Torontoverse = &pb.Vertex{ Id: &pb.Uuid{ Value: MustParseUUIDBytes("ae5c6bb4-ffc1-11eb-b867-244bfe5bf61a"), }, T: &NewsPublisher, } )
Functions ¶
func MustParseUUIDBytes ¶
func NewEdgePropertyQuery ¶
func NewEdgePropertyQuery(inner *pb.EdgeQuery, name string) *pb.EdgePropertyQuery
NewEdgePropertyQuery generates an edge property query.
func NewID ¶
NewID() returns a v1 UUID (or panics, which seems reasonable). The v1 UUID is used here for it's convenient ordering.
func NewPipeEdgeQuery ¶
func NewPipeEdgeQuery(inner *pb.VertexQuery, dir pb.EdgeDirection, t *pb.Identifier) *pb.EdgeQuery
NewPipeEdgeQuery returns a new query for the provided edge keys.
func NewPipeEdgeQueryLimit ¶
func NewPipeEdgeQueryLimit(inner *pb.VertexQuery, dir pb.EdgeDirection, t *pb.Identifier, limit int) *pb.EdgeQuery
NewPipeEdgeQueryLimit returns a new query for the provided edge keys.
func NewPipeEdgeQueryLimitOffset ¶
func NewPipeEdgeQueryLimitOffset(inner *pb.VertexQuery, dir pb.EdgeDirection, t *pb.Identifier, limit int, low *timestamppb.Timestamp) *pb.EdgeQuery
NewPipeEdgeQueryLimitOffset returns a new query for the provided edge keys.
func NewPipeVertexQuery ¶
func NewPipeVertexQuery(inner *pb.EdgeQuery, dir pb.EdgeDirection, t *pb.Identifier) *pb.VertexQuery
NewPipeVertexQuery returns a new query for the provided edge keys.
func NewSpecificEdgeQuery ¶
NewSpecificEdgeQuery returns a new query for the provided edge keys.
func NewSpecificVertexQuery ¶
func NewSpecificVertexQuery(ids ...*pb.Uuid) *pb.VertexQuery
NewSpecificVertexQuery returns a new query for the provided UUIDs.
func NewVertexPropertyQuery ¶
func NewVertexPropertyQuery(inner *pb.VertexQuery, name string) *pb.VertexPropertyQuery
NewVertexPropertyQuery generates a vertex property query.
func SetEdgePropertiesRequest ¶
func SetEdgePropertiesRequest(inner *pb.EdgeQuery, name string, jsonValue interface{}) (*pb.SetEdgePropertiesRequest, error)
SetEdgePropertiesRequest encodes the supplied value as JSON and returns a request to set that value for the supplied EdgeQuery and property name.
func SetVertexPropertiesRequest ¶
func SetVertexPropertiesRequest(inner *pb.VertexQuery, name string, jsonValue interface{}) (*pb.SetVertexPropertiesRequest, error)
SetVertexPropertiesRequest encodes the supplied value as JSON and returns a request to set that value for the supplied VertexQuery and property name.
Types ¶
type Article ¶
type Article struct { LoadedFrom string `json:"-"` ID string `json:"id"` Name string `json:"display_name"` PastNames []string `json:"past_names"` Headline string `json:"headline_html,omitempty"` Description string `json:"h2"` FeatureImage string `json:"img_url"` IsLive bool `json:"is_live"` Categories []string `json:"categories"` Authors []string `json:"authors"` Pitch float64 `json:"pitch,omitempty"` Camera map[string]interface{} `json:"camera,omitempty"` Promo string `json:"promo,omitempty"` PubDate string `json:"pub_date"` LastUpdated string `json:"last_updated,omitempty"` CodeCredit string `json:"code_credit"` PromoAt time.Time `json:"promo_start"` PromoUntil time.Time `json:"promo_until"` PromoWait Duration `json:"promo_wait"` PromoExpires time.Time `json:"promo_expires,omitempty"` Slug string `json:"slug,omitempty"` // Loc citygraph.LngLat `json:"loc,omitempty"` // Zoom float64 `json:"zoom,omitempty"` Related []string `json:"related,omitempty"` GeoJSONDatasets []*GeoJSONDataset `json:"geojson_datasets,omitempty"` Format string `json:"format,omitempty"` }
func (*Article) AllSlugTitles ¶
AllSlugTitles includes past slug titles form former headlines that may still be out there as valid links.
func (*Article) LoadBodyText ¶
func (*Article) VertexQuery ¶
func (a *Article) VertexQuery() (*pb.VertexQuery, error)
type Bar ¶
type Bar struct {
Style string `json:"style,omitempty"`
}
Bar contains details specific to bar POIs.
type BulkSender ¶
type Cafe ¶
type Cafe struct {
Style string `json:"style,omitempty"`
}
Cafe contains details specific to cafe POIs.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(conn grpc.ClientConnInterface) *Client
func (*Client) CreateEdge ¶
func (*Client) CreateVertex ¶
func (*Client) CreateVertexFromType ¶
func (*Client) DeleteEdges ¶
func (*Client) DeleteVertices ¶
func (*Client) GetAllEdgeProperties ¶
func (*Client) GetAllVertexProperties ¶
func (c *Client) GetAllVertexProperties(ctx context.Context, query *pb.VertexQuery) ([]*pb.VertexProperties, error)
func (*Client) GetEdgeProperties ¶
func (*Client) GetVertexProperties ¶
func (c *Client) GetVertexProperties(ctx context.Context, query *pb.VertexQuery, name string) ([]*pb.VertexProperty, error)
func (*Client) GetVertices ¶
func (*Client) NewBulkSender ¶
func (c *Client) NewBulkSender(ctx context.Context) (BulkSender, error)
func (*Client) SetEdgeProperties ¶
func (*Client) SetVertexProperties ¶
type FakeGraphClient ¶
type FakeGraphClient struct { sync.Mutex CreateVertexReqs []*pb.Vertex CreateVertexFromTypeReqs []*pb.Identifier CreateVertexFromTypeResps []*pb.Uuid GetVerticesReqs []*pb.VertexQuery GetVerticesResps [][]*pb.Vertex GetVertexPropertiesReqs []*pb.VertexPropertyQuery GetVertexPropertiesResps [][]*pb.VertexProperty SetVertexPropertiesReqs []*pb.SetVertexPropertiesRequest GetAllVertexPropertiesReqs []*pb.VertexQuery GetAllVertexPropertiesResps [][]*pb.VertexProperties CreateEdgeReqs []*pb.EdgeKey DeleteEdgesReqs []*pb.EdgeQuery GetEdgesReqs []*pb.EdgeQuery GetEdgesResps [][]*pb.Edge GetEdgePropertiesReqs []*pb.EdgePropertyQuery GetEdgePropertiesResps [][]*pb.EdgeProperty SetEdgePropertiesReqs []*pb.SetEdgePropertiesRequest GetAllEdgePropertiesReqs []*pb.EdgeQuery GetAllEdgePropertiesResps [][]*pb.EdgeProperties }
func (*FakeGraphClient) CreateEdge ¶
func (f *FakeGraphClient) CreateEdge(ctx context.Context, outbound *pb.Uuid, t *pb.Identifier, inbound *pb.Uuid) error
func (*FakeGraphClient) CreateVertex ¶
func (f *FakeGraphClient) CreateVertex(ctx context.Context, id *pb.Uuid, t *pb.Identifier) error
func (*FakeGraphClient) CreateVertexFromType ¶
func (f *FakeGraphClient) CreateVertexFromType(ctx context.Context, t *pb.Identifier) (*pb.Uuid, error)
func (*FakeGraphClient) DeleteEdges ¶
func (*FakeGraphClient) DeleteVertices ¶
func (c *FakeGraphClient) DeleteVertices(ctx context.Context, query *pb.VertexQuery) error
func (*FakeGraphClient) GetAllEdgeProperties ¶
func (f *FakeGraphClient) GetAllEdgeProperties(ctx context.Context, query *pb.EdgeQuery) ([]*pb.EdgeProperties, error)
func (*FakeGraphClient) GetAllVertexProperties ¶
func (f *FakeGraphClient) GetAllVertexProperties(ctx context.Context, query *pb.VertexQuery) ([]*pb.VertexProperties, error)
func (*FakeGraphClient) GetEdgeProperties ¶
func (f *FakeGraphClient) GetEdgeProperties(ctx context.Context, query *pb.EdgeQuery, name string) ([]*pb.EdgeProperty, error)
func (*FakeGraphClient) GetVertexProperties ¶
func (f *FakeGraphClient) GetVertexProperties(ctx context.Context, query *pb.VertexQuery, name string) ([]*pb.VertexProperty, error)
func (*FakeGraphClient) GetVertices ¶
func (f *FakeGraphClient) GetVertices(ctx context.Context, query *pb.VertexQuery) ([]*pb.Vertex, error)
func (*FakeGraphClient) NewBulkSender ¶
func (f *FakeGraphClient) NewBulkSender(ctx context.Context) (BulkSender, error)
func (*FakeGraphClient) SetEdgeProperties ¶
func (*FakeGraphClient) SetVertexProperties ¶
func (f *FakeGraphClient) SetVertexProperties(ctx context.Context, query *pb.VertexQuery, name string, jsonValue interface{}) error
type GeoJSONDataset ¶
type GeoJSONDataset struct { ID string `json:"id"` Name string `json:"name"` URL string `json:"url"` Render string `json:"render,omitempty"` Source *Source `json:"source,omitempty"` Sources []*Source `json:"sources,omitempty"` }
func (*GeoJSONDataset) VertexQuery ¶
func (d *GeoJSONDataset) VertexQuery() (*pb.VertexQuery, error)
type GraphClient ¶
type GraphClient interface { CreateVertex(context.Context, *pb.Uuid, *pb.Identifier) error CreateVertexFromType(context.Context, *pb.Identifier) (*pb.Uuid, error) DeleteVertices(context.Context, *pb.VertexQuery) error GetVertexProperties(context.Context, *pb.VertexQuery, string) ([]*pb.VertexProperty, error) SetVertexProperties(context.Context, *pb.VertexQuery, string, interface{}) error GetVertices(context.Context, *pb.VertexQuery) ([]*pb.Vertex, error) GetAllVertexProperties(context.Context, *pb.VertexQuery) ([]*pb.VertexProperties, error) DeleteEdges(context.Context, *pb.EdgeQuery) error CreateEdge(context.Context, *pb.Uuid, *pb.Identifier, *pb.Uuid) error GetEdges(context.Context, *pb.EdgeQuery) ([]*pb.Edge, error) GetEdgeProperties(context.Context, *pb.EdgeQuery, string) ([]*pb.EdgeProperty, error) SetEdgeProperties(context.Context, *pb.EdgeQuery, string, interface{}) error GetAllEdgeProperties(context.Context, *pb.EdgeQuery) ([]*pb.EdgeProperties, error) NewBulkSender(ctx context.Context) (BulkSender, error) }
type LngLat ¶
LngLat represents a geographic coordinate in the map. Encodes directly into a Mapbox-compatible json object.
type Module ¶
type Module struct { ID string `json:"id"` Name string `json:"display_name"` Headline string `json:"headline_html,omitempty"` Description string `json:"desc"` FeatureImage string `json:"img_url"` Format string `json:"format"` Categories []string `json:"categories"` Creators []string `json:"creators"` Camera map[string]interface{} `json:"camera,omitempty"` PubDate string `json:"pub_date"` LastUpdated string `json:"last_updated,omitempty"` CodeCredit string `json:"code_credit"` }
func (*Module) VertexQuery ¶
func (a *Module) VertexQuery() (*pb.VertexQuery, error)
type Place ¶
type Place struct { ID string `json:"id"` Name string `json:"name"` Desc string `json:"description"` AddedAt time.Time `json:"added_at"` // PhoneNumber should be formatted like this: "416-902-7200". PhoneNumber string `json:"phone_number"` Address string `json:"street_address"` // Status is all OK if missing/empty otherwise "Closed" and "Temporarily closed". Status string `json:"status,omitempty"` // Established records when the business was established. Established string `json:"established"` // Instagram is the business or location's Instagram username. Instagram string `json:"instagram"` // Twitter is the business or location's Twitter username. Twitter string `json:"twitter"` ForFeed bool `json:"for_feed"` URL string `json:"url"` ShortName string `json:"short_name"` Type string `json:"type"` // Restaurant is optional, will be present only for some restaurant-type locations. Restaurant *Restaurant `json:"restaurant"` // Bar is optional, will be present only for some bar-type locations. Bar *Bar `json:"bar"` // Cafe is optional, will be present only for some cafe-type locations. Cafe *Cafe `json:"cafe"` Sprite string `json:"sprite"` Location LngLat `json:"location"` Images []*Image `json:"images,omitempty"` Locations []*PlaceLocation `json:"locations"` }
func (*Place) VertexQuery ¶
func (p *Place) VertexQuery() (*pb.VertexQuery, error)
type PlaceLocation ¶
type PlaceLocation struct { ID string `json:"id"` Name string `json:"name"` // Status is all OK if missing/empty otherwise "Closed" and "Temporarily closed". Status string `json:"status,omitempty"` // PhoneNumber should be formatted like this: "416-902-7200". PhoneNumber string `json:"phone_number"` // Address holds the street address of the location in the form "123 Sesame St W". Address string `json:"street_address"` City string `json:"city,omitempty"` Location LngLat `json:"location"` Images []*Image `json:"images,omitempty"` // Restaurant is optional, will be present only for some restaurant-type locations. Restaurant *Restaurant `json:"restaurant"` // Bar is optional, will be present only for some bar-type locations. Bar *Bar `json:"bar"` // Cafe is optional, will be present only for some cafe-type locations. Cafe *Cafe `json:"cafe"` }
func (*PlaceLocation) SlugID ¶
func (p *PlaceLocation) SlugID() (string, error)
func (*PlaceLocation) VertexQuery ¶
func (p *PlaceLocation) VertexQuery() (*pb.VertexQuery, error)
type Restaurant ¶
type Restaurant struct { Style string `json:"style,omitempty"` OpenTable string `json:"open_table,omitempty"` Ritual string `json:"ritual,omitempty"` SkipTheDishes string `json:"skip_the_dishes,omitempty"` Custom string `json:"custom,omitempty"` }
Restaurant contains details specific to restaurant POIs.