google-api-go-client

module
v0.0.0-...-ada7ae8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2016 License: BSD-3-Clause

README

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.

Directories

Path Synopsis
adexchangebuyer
adexchangeseller
admin
adsense
adsensehost
analytics
androidenterprise
androidpublisher
appengine
appsactivity
appstate
autoscaler
bigquery
blogger
books
calendar
civicinfo
classroom
cloudbilling
cloudbuild
clouddebugger
cloudlatencytest
cloudmonitoring
cloudresourcemanager
cloudtrace
clouduseraccounts
compute
container
content
coordinate
customsearch
dataflow
dataproc
datastore
deploymentmanager
dfareporting
discovery
dns
doubleclickbidmanager
doubleclicksearch
drive
fitness
freebase
fusiontables
games
gamesconfiguration
gamesmanagement
gan
genomics
Package gensupport is an internal implementation detail used by code generated by the google-api-go-generator tool.
Package gensupport is an internal implementation detail used by code generated by the google-api-go-generator tool.
gmail
Package googleapi contains the common code shared by all Google API libraries.
Package googleapi contains the common code shared by all Google API libraries.
groupsmigration
groupssettings
iam
identitytoolkit
kgsearch
licensing
logging
manager
mapsengine
mirror
oauth2
pagespeedonline
partners
playmoviespartner
plus
plusdomains
prediction
proximitybeacon
pubsub
qpxexpress
replicapool
replicapoolupdater
reseller
resourceviews
script
serviceregistry
siteverification
spectrum
sqladmin
storage
storagetransfer
tagmanager
taskqueue
tasks
translate
urlshortener
vision
webfonts
webmasters
youtube
youtubeanalytics
youtubereporting

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL