946c8399e2
Exclude minio-go for now (pin to 3.x.y). |
||
---|---|---|
.. | ||
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 | ||
cloudiot | ||
cloudkms/v1 | ||
cloudmonitoring/v2beta2 | ||
cloudresourcemanager | ||
cloudtasks/v2beta2 | ||
cloudtrace | ||
clouduseraccounts | ||
compute | ||
consumersurveys/v2 | ||
container | ||
content | ||
customsearch/v1 | ||
dataflow/v1b3 | ||
dataproc | ||
datastore | ||
deploymentmanager | ||
dfareporting | ||
dialogflow/v2beta1 | ||
discovery/v1 | ||
dlp/v2beta1 | ||
dns | ||
doubleclickbidmanager/v1 | ||
doubleclicksearch/v2 | ||
drive | ||
examples | ||
firebasedynamiclinks/v1 | ||
firebaseremoteconfig/v1 | ||
firebaserules/v1 | ||
firestore/v1beta1 | ||
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/v1 | ||
monitoring/v3 | ||
oauth2 | ||
option | ||
oslogin | ||
pagespeedonline | ||
partners/v2 | ||
people/v1 | ||
playcustomapp/v1 | ||
playmoviespartner/v1 | ||
plus/v1 | ||
plusdomains/v1 | ||
poly/v1 | ||
prediction | ||
proximitybeacon/v1beta1 | ||
pubsub | ||
qpxexpress/v1 | ||
replicapool | ||
replicapoolupdater/v1beta1 | ||
reseller/v1 | ||
resourceviews | ||
runtimeconfig | ||
safebrowsing/v4 | ||
script/v1 | ||
searchconsole/v1 | ||
serviceconsumermanagement/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 | ||
testing/v1 | ||
toolresults | ||
tpu/v1alpha1 | ||
tracing/v2 | ||
translate/v2 | ||
transport | ||
urlshortener/v1 | ||
vault/v1 | ||
videointelligence/v1beta1 | ||
vision | ||
webfonts/v1 | ||
webmasters/v3 | ||
youtube/v3 | ||
youtubeanalytics | ||
youtubereporting/v1 | ||
.gitignore | ||
.hgtags | ||
.travis.yml | ||
api-list.json | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
GettingStarted.md | ||
key.json.enc | ||
LICENSE | ||
NOTES | ||
README.md | ||
TODO |
Google APIs Client Library for Go
Getting Started
$ go get google.golang.org/api/tasks/v1
$ go get google.golang.org/api/moderator/v1
$ go get google.golang.org/api/urlshortener/v1
... etc ...
and using:
package main
import (
"net/http"
"google.golang.org/api/urlshortener/v1"
)
func main() {
svc, err := urlshortener.New(http.DefaultClient)
// ...
}
- For a longer tutorial, see the Getting Started guide.
- For examples, see the examples directory.
- For support, use the golang-nuts mailing list.
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.
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.
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").
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.