Skip to content

Commit

Permalink
Merge pull request #27 from codingsince1985/httptest
Browse files Browse the repository at this point in the history
Httptest
  • Loading branch information
dougnukem committed May 13, 2016
2 parents 5e5ddc6 + 316377e commit ed5a6d2
Show file tree
Hide file tree
Showing 15 changed files with 2,960 additions and 76 deletions.
10 changes: 8 additions & 2 deletions bing/geocoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ type geocodeResponse struct {
}

// Geocoder constructs Bing geocoder
func Geocoder(key string) geo.Geocoder {
func Geocoder(key string, baseURLs ...string) geo.Geocoder {
var url string
if len(baseURLs) > 0 {
url = baseURLs[0]
} else {
url = "http://dev.virtualearth.net/REST/v1/Locations*key=" + key
}
return geo.HTTPGeocoder{
EndpointBuilder: baseURL("http://dev.virtualearth.net/REST/v1/Locations*key=" + key),
EndpointBuilder: baseURL(url),
ResponseParserFactory: func() geo.ResponseParser { return &geocodeResponse{} },
}
}
Expand Down
Loading

0 comments on commit ed5a6d2

Please sign in to comment.