mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 19:25:16 +00:00
20 lines
534 B
Go
Executable File
20 lines
534 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/micro/services/clients/go/geocoding"
|
|
"os"
|
|
)
|
|
|
|
// Lookup returns a geocoded address including normalized address and gps coordinates. All fields are optional, provide more to get more accurate results
|
|
func GeocodeAnAddress() {
|
|
geocodingService := geocoding.NewGeocodingService(os.Getenv("MICRO_API_TOKEN"))
|
|
rsp, err := geocodingService.Lookup(&geocoding.LookupRequest{
|
|
Address: "10 russell st",
|
|
City: "london",
|
|
Country: "uk",
|
|
Postcode: "wc2b",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|