mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
21 lines
503 B
Go
Executable File
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)
|
|
}
|