- Notifications
You must be signed in to change notification settings - Fork1.2k
Auto-generated Google APIs for Go.
License
googleapis/google-api-go-client
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
$ 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 mainimport ("context""net/http""google.golang.org/api/urlshortener/v1")funcmain() {ctx:=context.Background()svc,err:=urlshortener.NewService(ctx)// ...}
- For a longer tutorial, see theGetting Started guide.
- For examples, see theexamples directory.
- For support, use thegolang-nuts mailing list.
These are auto-generated Go libraries from the Google Discovery Service's JSON description files.
Due to the auto-generated nature of this collection of libraries they may contain breaking changes from one release tothe next. The generator itself and the code it produces are considered beta for this reason.
These client libraries are officially supported by Google. However, the libraries are considered complete and are inmaintenance mode. This means that we will address critical bugs and security issues but will not add any new features.
If you're working with Google Cloud Platform APIs such as Datastore or Pub/Sub, please use theCloud Client Libraries for Go instead. These are the new and idiomaticGo libraries targeted specifically at Google Cloud Platform Services.
By default, each API will useGoogle Application Default Credentialsfor authorization credentials used in calling the API endpoints. This will allow your application to run in manyenvironments without requiring explicit configuration.
// import "google.golang.org/api/sheets/v4"client,err:=sheets.NewService(ctx)
To authorize using aJSON key file, passoption.WithCredentialsFile to theNewServicefunction of the desired package. For example:
client,err:=sheets.NewService(ctx,option.WithCredentialsFile("path/to/keyfile.json"))
You can exert more control over authorization by using thegolang.org/x/oauth2package to create anoauth2.TokenSource. Then passoption.WithTokenSourceto theNewService function:
tokenSource:=...svc,err:=sheets.NewService(ctx,option.WithTokenSource(tokenSource))
For some more information related to all of the generated clients please read through ourpackage documentation.
About
Auto-generated Google APIs for Go.
Topics
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.