mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
Commit from m3o/m3o action
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
)
|
||||
|
||||
type Place interface {
|
||||
Autocomplete(*AutocompleteRequest) (*AutocompleteResponse, error)
|
||||
Nearby(*NearbyRequest) (*NearbyResponse, error)
|
||||
Search(*SearchRequest) (*SearchResponse, error)
|
||||
}
|
||||
@@ -21,7 +22,15 @@ type PlaceService struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
// Search for places nearby, points of interest and geographic locations
|
||||
// Autocomplete queries (coming soon)
|
||||
func (t *PlaceService) Autocomplete(request *AutocompleteRequest) (*AutocompleteResponse, error) {
|
||||
|
||||
rsp := &AutocompleteResponse{}
|
||||
return rsp, t.client.Call("place", "Autocomplete", request, rsp)
|
||||
|
||||
}
|
||||
|
||||
// Find places nearby using a location
|
||||
func (t *PlaceService) Nearby(request *NearbyRequest) (*NearbyResponse, error) {
|
||||
|
||||
rsp := &NearbyResponse{}
|
||||
@@ -29,7 +38,7 @@ func (t *PlaceService) Nearby(request *NearbyRequest) (*NearbyResponse, error) {
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Search for places by text query
|
||||
func (t *PlaceService) Search(request *SearchRequest) (*SearchResponse, error) {
|
||||
|
||||
rsp := &SearchResponse{}
|
||||
@@ -37,6 +46,12 @@ func (t *PlaceService) Search(request *SearchRequest) (*SearchResponse, error) {
|
||||
|
||||
}
|
||||
|
||||
type AutocompleteRequest struct {
|
||||
}
|
||||
|
||||
type AutocompleteResponse struct {
|
||||
}
|
||||
|
||||
type NearbyRequest struct {
|
||||
// Keyword to include in the search
|
||||
Keyword string `json:"keyword"`
|
||||
|
||||
Reference in New Issue
Block a user