commit | a59c1355aff5abf0f60c182f9fe9b8acb31ac40e | [log] [tgz] |
---|---|---|
author | Glenn Lewis <gmlewis@google.com> | Wed Feb 25 13:55:37 2015 -0800 |
committer | Glenn Lewis <gmlewis@google.com> | Mon Mar 02 19:38:51 2015 +0000 |
tree | 21b6a49ba0e79e3504b2356cce085d4a8f8ab515 | |
parent | 77d38fd3dca7ee9102bb2af20f14d85fb209c6ec [diff] |
google-api-go-client: Fix basePath bug The Discovery JSON doc here: https://www.googleapis.com/discovery/v1/apis/ was being used as the top-level API struct for each API. Look at pubsub:v1beta2 as an example. It says: { "kind": "discovery#directoryItem", "id": "pubsub:v1beta2", "name": "pubsub", "version": "v1beta2", "title": "Google Cloud Pub/Sub API", "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/pubsub/v1beta2/rest", "discoveryLink": "./apis/pubsub/v1beta2/rest", "icons": { "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, "documentationLink": "", "preferred": true } Note that "rootUrl" and "servicePath" are not specified. When the actual API is slurped in, however, these top-level fields are provided but not updated. For example, pubsub:v1beta2 API looks like this when slurped in: { "kind": "discovery#restDescription", "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/lQI8FHp12NFK29a25qmlTN4Bqeo\"", "discoveryVersion": "v1", "id": "pubsub:v1beta2", "name": "pubsub", "version": "v1beta2", "revision": "20150213", "title": "Google Cloud Pub/Sub API", "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", "ownerDomain": "google.com", "ownerName": "Google", "icons": { "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, "documentationLink": "", "protocol": "rest", "baseUrl": "https://pubsub.googleapis.com/v1beta2/", "basePath": "/v1beta2/", "rootUrl": "https://pubsub.googleapis.com/", "servicePath": "v1beta2/", "batchPath": "batch", ... } Note that "rootUrl" and "servicePath" are now supplied in the actual slurped API. Previously, the basePath was being reported as "https://www.googleapis.com/v1beta2/" which is not correct. With this change, the basePath is now correctly being reported as "https://pubsub.googleapis.com/v1beta2/" Change-Id: Ie6df5463a5d8079a6245e04f187ca64b736baea2 Reviewed-on: https://code-review.googlesource.com/2010 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
These are auto-generated Go libraries from the Google Discovery Service's JSON description files of the available “new style” Google APIs.
Announcement email: http://groups.google.com/group/golang-nuts/browse_thread/thread/6c7281450be9a21e
Getting started documentation:
http://code.google.com/p/google-api-go-client/wiki/GettingStarted
In summary:
$ go get google.golang.org/api/storage/v1 $ go get google.golang.org/api/tasks/v1 $ go get google.golang.org/api/moderator/v1 ... etc ...
For docs, see e.g.:
https://godoc.org/google.golang.org/api/storage/v1
The package of a given import is the second-to-last component, before the version number.
For examples, see:
https://github.com/google/google-api-go-client/tree/master/examples
For support, use the golang-nuts@ mailing list: