google-api-go-client: Make Media support resumable uploads.

Allow users to use Media methods for resumable uploads. This means that:
* A ReaderAt is no longer needed for resumable uploads.
* The size of the content no long needs to be known a priori.
* The use can configure the chunk size to be used.

ResumableMedia is now deprecated in favor of Media.

Change-Id: Ifa3845f88abe82773392d36f34bbd3ce0e3c1f0a
Reviewed-on: https://code-review.googlesource.com/4027
Reviewed-by: Dave Day <djd@golang.org>
29 files changed
tree: 1ee0bc0495046e40f8eb71052109e963ec917f7c
  1. adexchangebuyer/
  2. adexchangeseller/
  3. admin/
  4. adsense/
  5. adsensehost/
  6. analytics/
  7. androidenterprise/
  8. androidpublisher/
  9. appengine/
  10. appsactivity/
  11. appstate/
  12. autoscaler/
  13. bigquery/
  14. blogger/
  15. books/
  16. calendar/
  17. civicinfo/
  18. classroom/
  19. cloudbilling/
  20. clouddebugger/
  21. cloudlatencytest/
  22. cloudmonitoring/
  23. cloudresourcemanager/
  24. cloudtrace/
  25. clouduseraccounts/
  26. compute/
  27. container/
  28. content/
  29. coordinate/
  30. customsearch/
  31. dataflow/
  32. dataproc/
  33. datastore/
  34. deploymentmanager/
  35. dfareporting/
  36. discovery/
  37. dns/
  38. doubleclickbidmanager/
  39. doubleclicksearch/
  40. drive/
  41. examples/
  42. fitness/
  43. freebase/
  44. fusiontables/
  45. games/
  46. gamesconfiguration/
  47. gamesmanagement/
  48. gan/
  49. genomics/
  50. gensupport/
  51. gmail/
  52. google-api-go-generator/
  53. googleapi/
  54. groupsmigration/
  55. groupssettings/
  56. identitytoolkit/
  57. integration-tests/
  58. kgsearch/
  59. lib/
  60. licensing/
  61. logging/
  62. manager/
  63. mapsengine/
  64. mirror/
  65. oauth2/
  66. pagespeedonline/
  67. partners/
  68. playmoviespartner/
  69. plus/
  70. plusdomains/
  71. prediction/
  72. proximitybeacon/
  73. pubsub/
  74. qpxexpress/
  75. replicapool/
  76. replicapoolupdater/
  77. reseller/
  78. resourceviews/
  79. script/
  80. siteverification/
  81. spectrum/
  82. sqladmin/
  83. storage/
  84. storagetransfer/
  85. tagmanager/
  86. taskqueue/
  87. tasks/
  88. translate/
  89. urlshortener/
  90. webfonts/
  91. webmasters/
  92. youtube/
  93. youtubeanalytics/
  94. youtubereporting/
  95. .hgignore
  96. .hgtags
  97. .travis.yml
  98. api-list.json
  99. AUTHORS
  100. CONTRIBUTING.md
  101. CONTRIBUTORS
  102. GettingStarted.md
  103. key.json.enc
  104. LICENSE
  105. Makefile
  106. NOTES
  107. README.md
  108. TODO
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.