.. | ||
acceleratedmobilepageurl/v1 | ||
adexchangebuyer | ||
adexchangebuyer2/v2beta1 | ||
adexchangeseller | ||
adexperiencereport/v1 | ||
admin | ||
adsense | ||
adsensehost/v4.1 | ||
analytics | ||
analyticsreporting/v4 | ||
androiddeviceprovisioning/v1 | ||
androidenterprise/v1 | ||
androidmanagement/v1 | ||
androidpublisher | ||
appengine | ||
appsactivity/v1 | ||
appstate/v1 | ||
bigquery/v2 | ||
bigquerydatatransfer/v1 | ||
blogger | ||
books/v1 | ||
calendar/v3 | ||
civicinfo/v2 | ||
classroom/v1 | ||
cloudbilling/v1 | ||
cloudbuild/v1 | ||
clouddebugger/v2 | ||
clouderrorreporting/v1beta1 | ||
cloudfunctions | ||
cloudkms/v1 | ||
cloudmonitoring/v2beta2 | ||
cloudresourcemanager | ||
cloudtrace | ||
clouduseraccounts | ||
compute | ||
consumersurveys/v2 | ||
container/v1 | ||
content | ||
customsearch/v1 | ||
dataflow/v1b3 | ||
dataproc | ||
datastore | ||
deploymentmanager | ||
dfareporting | ||
discovery/v1 | ||
dlp/v2beta1 | ||
dns | ||
doubleclickbidmanager/v1 | ||
doubleclicksearch/v2 | ||
drive | ||
examples | ||
firebasedynamiclinks/v1 | ||
firebaserules/v1 | ||
fitness/v1 | ||
fusiontables | ||
games/v1 | ||
gamesconfiguration/v1configuration | ||
gamesmanagement/v1management | ||
genomics | ||
gensupport | ||
gmail/v1 | ||
google-api-go-generator | ||
googleapi | ||
groupsmigration/v1 | ||
groupssettings/v1 | ||
iam/v1 | ||
identitytoolkit/v3 | ||
integration-tests/storage | ||
internal | ||
iterator | ||
kgsearch/v1 | ||
language | ||
lib/codereview | ||
licensing/v1 | ||
logging | ||
manufacturers/v1 | ||
mirror/v1 | ||
ml | ||
monitoring/v3 | ||
oauth2 | ||
option | ||
oslogin/v1alpha | ||
pagespeedonline | ||
partners/v2 | ||
people/v1 | ||
playcustomapp/v1 | ||
playmoviespartner/v1 | ||
plus/v1 | ||
plusdomains/v1 | ||
prediction | ||
proximitybeacon/v1beta1 | ||
pubsub | ||
qpxexpress/v1 | ||
replicapool | ||
replicapoolupdater/v1beta1 | ||
reseller/v1 | ||
resourceviews | ||
runtimeconfig | ||
safebrowsing/v4 | ||
script/v1 | ||
searchconsole/v1 | ||
servicecontrol/v1 | ||
servicemanagement/v1 | ||
serviceuser/v1 | ||
sheets/v4 | ||
siteverification/v1 | ||
slides/v1 | ||
sourcerepo/v1 | ||
spanner/v1 | ||
spectrum/v1explorer | ||
speech | ||
sqladmin | ||
storage | ||
storagetransfer/v1 | ||
streetviewpublish/v1 | ||
support/bundler | ||
surveys/v2 | ||
tagmanager | ||
taskqueue | ||
tasks/v1 | ||
toolresults | ||
tracing/v2 | ||
translate/v2 | ||
transport | ||
urlshortener/v1 | ||
vault/v1 | ||
videointelligence/v1beta1 | ||
vision/v1 | ||
webfonts/v1 | ||
webmasters/v3 | ||
youtube/v3 | ||
youtubeanalytics | ||
youtubereporting/v1 | ||
.hgignore | ||
.hgtags | ||
.travis.yml | ||
api-list.json | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
GettingStarted.md | ||
key.json.enc | ||
LICENSE | ||
Makefile | ||
NOTES | ||
README.md | ||
TODO |
Google APIs Client Library for Go
Library maintenance
This client library is supported, but in maintenance mode only. We are fixing necessary bugs and adding essential features to ensure this library continues to meet your needs for accessing Google APIs. Non-critical issues will be closed. Any issue may be reopened if it is causing ongoing problems.
Status
These are auto-generated Go libraries from the Google Discovery Service's JSON description files of the available "new style" Google APIs.
Due to the auto-generated nature of this collection of libraries, complete APIs or specific versions can appear or go away without notice. As a result, you should always locally vendor any API(s) that your code relies upon.
If you're working with Google Cloud Platform APIs such as Datastore or Pub/Sub, consider using the Cloud Client Libraries for Go instead. These are the new and idiomatic Go libraries targeted specifically at Google Cloud Platform Services.
The generator itself and the code it produces are beta. Some APIs are alpha/beta, and indicated as such in the import path (e.g., "google.golang.org/api/someapi/v1alpha").
Announcement email:
Getting started documentation:
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.:
The package of a given import is the second-to-last component, before the version number.
For examples, see:
For support, use the golang-nuts@ mailing list:
Application Default Credentials Example
Application Default Credentials provide a simplified way to obtain credentials for authenticating with Google APIs.
The Application Default Credentials authenticate as the application itself, which make them great for working with Google Cloud APIs like Storage or Datastore. They are the recommended form of authentication when building applications that run on Google Compute Engine or Google App Engine.
Default credentials are provided by the golang.org/x/oauth2/google
package. To use them, add the following import:
import "golang.org/x/oauth2/google"
Some credentials types require you to specify scopes, and service entry points may not inject them. If you encounter this situation you may need to specify scopes as follows:
import (
"golang.org/x/net/context"
"golang.org/x/oauth2/google"
"google.golang.org/api/compute/v1"
)
func main() {
// Use oauth2.NoContext if there isn't a good context to pass in.
ctx := context.Background()
client, err := google.DefaultClient(ctx, compute.ComputeScope)
if err != nil {
//...
}
computeService, err := compute.New(client)
if err != nil {
//...
}
}
If you need a oauth2.TokenSource
, use the DefaultTokenSource
function:
ts, err := google.DefaultTokenSource(ctx, scope1, scope2, ...)
if err != nil {
//...
}
client := oauth2.NewClient(ctx, ts)
See also: golang.org/x/oauth2/google package documentation.