Files
services/examples/evchargers/search/go/searchByLocation.go
2021-10-01 14:17:54 +01:00

21 lines
503 B
Go
Executable File

package example
import (
"fmt"
"github.com/micro/services/clients/go/evchargers"
"os"
)
// Search by giving a coordinate and a max distance, or bounding box and optional filters
func SearchByLocation() {
evchargersService := evchargers.NewEvchargersService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := evchargersService.Search(&evchargers.SearchRequest{
Distance: 2000,
Location: &evchargers.Coordinates{
Latitude: 51.53336351319885,
Longitude: -0.0252,
},
})
fmt.Println(rsp, err)
}