Documentation ¶
Overview ¶
Package place provides support for managing place data in the database.
Index ¶
- Variables
- type City
- type Place
- type Store
- func (s Store) QueryByCategory(ctx context.Context, traceID string, category string) ([]Place, error)
- func (s Store) QueryByCity(ctx context.Context, traceID string, cityID string) ([]Place, error)
- func (s Store) QueryByID(ctx context.Context, traceID string, placeID string) (Place, error)
- func (s Store) QueryByName(ctx context.Context, traceID string, name string) (Place, error)
- func (s Store) Upsert(ctx context.Context, traceID string, plc Place) (Place, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("place not found")
)
Set of error variables for CRUD operations.
Functions ¶
This section is empty.
Types ¶
type City ¶
type City struct {
ID string `json:"id"`
}
City is used to capture the city id in relationships.
type Place ¶
type Place struct { ID string `json:"id,omitempty"` Category string `json:"category"` City City `json:"city"` 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.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages the set of API's for place access.
func (Store) QueryByCategory ¶
func (s Store) QueryByCategory(ctx context.Context, traceID string, category string) ([]Place, error)
QueryByCategory returns the collection of places from the database by the cagtegory name.
func (Store) QueryByCity ¶
QueryByCity returns the collection of places from the database by the city id.
func (Store) QueryByName ¶
QueryByName returns the specified place from the database by name.
Click to show internal directories.
Click to hide internal directories.