tryp is a minimal wrapper for the Google Maps Platform Distance Matrix API.
go get github.com/jamiekieranmartin/tryp
Otherwise you can download the binary from Releases
tryp -key "my super secret key"
// make new client
client, err := tryp.NewClient("my super secret key")
if err != nil {
panic(err)
}
// get distance matrix
response, err := client.Get(tryp.Request{
Origins: []string{"Southbank, Brisbane"},
Destinations: []string{"Fortitude Valley, Brisbane"},
})
if err != nil {
panic(err)
}
fmt.Println(response)
Google Maps Platform API key. Get one here: https://developers.google.com/maps/documentation/distance-matrix/get-api-key
trpy -key "my super secret key"
Path a custom configuration file. Defaults to ./config.toml
.
tryp -config "./path/to/my/file.toml"
Output to JSON file. Defaults to none.
trpy -key "my super secret key" -out "./result.json"
# config.toml
key = "my super secret key"
[request]
origins = ["Southbank, Brisbane"]
destinations = ["Fortitude Valley, Brisbane"]