chronograf/vendor/google.golang.org/api
Brandon Farmer c4e40b7643 Update flux golang dependencies 2018-09-10 15:20:56 -07:00
..
acceleratedmobilepageurl/v1
adexchangebuyer
adexchangebuyer2/v2beta1
adexchangeseller
admin
adsense
adsensehost/v4.1
analytics
analyticsreporting/v4
androidenterprise/v1
androidpublisher
appengine
appsactivity/v1
appstate/v1
autoscaler/v1beta2
bigquery/v2
blogger
books/v1
calendar/v3
civicinfo/v2
classroom/v1
cloudbilling/v1
cloudbuild/v1
clouddebugger/v2
clouderrorreporting/v1beta1
cloudkms/v1beta1
cloudlatencytest/v2
cloudmonitoring/v2beta2
cloudresourcemanager
cloudtrace/v1
clouduseraccounts
compute
consumersurveys/v2
container/v1
content
coordinate/v1
customsearch/v1
dataflow/v1b3
dataproc
datastore
deploymentmanager
dfareporting
discovery/v1
dns
doubleclickbidmanager/v1
doubleclicksearch/v2
drive
examples
firebasedynamiclinks/v1
firebaserules/v1
fitness/v1
freebase/v1
fusiontables
games/v1
gamesconfiguration/v1configuration
gamesmanagement/v1management
gan/v1beta1
genomics
gensupport
gmail/v1
google-api-go-generator
googleapi
groupsmigration/v1
groupssettings/v1
iam
identitytoolkit/v3
integration-tests/storage
internal
iterator
kgsearch/v1
language
lib/codereview
licensing/v1
logging
manager/v1beta2
manufacturers/v1
mapsengine
mirror/v1
ml/v1beta1
monitoring/v3
oauth2
option
pagespeedonline
partners/v2
people/v1
playmoviespartner/v1
plus/v1
plusdomains/v1
prediction
proximitybeacon/v1beta1
pubsub
qpxexpress/v1
replicapool
replicapoolupdater/v1beta1
reseller
resourceviews
runtimeconfig
safebrowsing/v4
script/v1
searchconsole/v1
servicecontrol/v1
servicemanagement/v1
serviceregistry/v0.alpha
sheets/v4
siteverification/v1
slides/v1
spectrum/v1explorer
speech/v1beta1
sqladmin
storage
storagetransfer/v1
support/bundler
surveys/v2
tagmanager/v1
taskqueue
tasks/v1
toolresults/v1beta3
translate/v2
transport
urlshortener/v1
vision/v1
webfonts/v1
webmasters/v3
youtube/v3
youtubeanalytics
youtubereporting/v1
.hgignore
.hgtags
.travis.yml
AUTHORS
CONTRIBUTING.md
CONTRIBUTORS
GettingStarted.md
LICENSE
Makefile
NOTES
README.md
TODO
api-list.json
key.json.enc

README.md

Google APIs Client Library for Go

Status

Build 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.

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.