Files
services/examples/location/search/go/searchForLocations.go
2021-09-16 12:52:36 +01:00

23 lines
472 B
Go
Executable File

package example
import (
"fmt"
"github.com/micro/services/clients/go/location"
"os"
)
// Search for entities in a given radius
func SearchForLocations() {
locationService := location.NewLocationService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := locationService.Search(&location.SearchRequest{
Center: &location.Point{
Latitude: 51.511061,
Longitude: -0.120022,
},
NumEntities: 10,
Radius: 100,
Type: "bike",
})
fmt.Println(rsp, err)
}