refactor(auth): refactor GetGRPCTransportCredsAndEndpoint return type to struct (#11599)

* Embed google.golang.org/grpc/credentials.TransportCredentials interface in new struct type with additional data.

refs: #11588
3 files changed
tree: 974adb5fb425a145a755b9a76ddc8eb30d66c1d0
  1. .devcontainer/
  2. .github/
  3. accessapproval/
  4. accesscontextmanager/
  5. advisorynotifications/
  6. ai/
  7. aiplatform/
  8. alloydb/
  9. analytics/
  10. apigateway/
  11. apigeeconnect/
  12. apigeeregistry/
  13. apihub/
  14. apikeys/
  15. appengine/
  16. apphub/
  17. apps/
  18. area120/
  19. artifactregistry/
  20. asset/
  21. assuredworkloads/
  22. auth/
  23. automl/
  24. backupdr/
  25. baremetalsolution/
  26. batch/
  27. beyondcorp/
  28. bigquery/
  29. bigtable/
  30. billing/
  31. binaryauthorization/
  32. certificatemanager/
  33. channel/
  34. chat/
  35. civil/
  36. cloudbuild/
  37. cloudcontrolspartner/
  38. clouddms/
  39. cloudprofiler/
  40. cloudquotas/
  41. cloudtasks/
  42. commerce/
  43. compute/
  44. confidentialcomputing/
  45. config/
  46. contactcenterinsights/
  47. container/
  48. containeranalysis/
  49. datacatalog/
  50. dataflow/
  51. dataform/
  52. datafusion/
  53. datalabeling/
  54. dataplex/
  55. dataproc/
  56. dataqna/
  57. datastore/
  58. datastream/
  59. debugger/
  60. deploy/
  61. developerconnect/
  62. dialogflow/
  63. discoveryengine/
  64. dlp/
  65. documentai/
  66. domains/
  67. edgecontainer/
  68. edgenetwork/
  69. errorreporting/
  70. essentialcontacts/
  71. eventarc/
  72. filestore/
  73. firestore/
  74. functions/
  75. gkebackup/
  76. gkeconnect/
  77. gkehub/
  78. gkemulticloud/
  79. grafeas/
  80. gsuiteaddons/
  81. httpreplay/
  82. iam/
  83. iap/
  84. identitytoolkit/
  85. ids/
  86. internal/
  87. iot/
  88. kms/
  89. language/
  90. lifesciences/
  91. logging/
  92. longrunning/
  93. managedidentities/
  94. managedkafka/
  95. maps/
  96. mediatranslation/
  97. memcache/
  98. memorystore/
  99. metastore/
  100. migrationcenter/
  101. monitoring/
  102. netapp/
  103. networkconnectivity/
  104. networkmanagement/
  105. networksecurity/
  106. networkservices/
  107. notebooks/
  108. optimization/
  109. oracledatabase/
  110. orchestration/
  111. orgpolicy/
  112. osconfig/
  113. oslogin/
  114. parallelstore/
  115. parametermanager/
  116. phishingprotection/
  117. policysimulator/
  118. policytroubleshooter/
  119. privatecatalog/
  120. privilegedaccessmanager/
  121. profiler/
  122. pubsub/
  123. pubsublite/
  124. rapidmigrationassessment/
  125. recaptchaenterprise/
  126. recommendationengine/
  127. recommender/
  128. redis/
  129. resourcemanager/
  130. resourcesettings/
  131. retail/
  132. rpcreplay/
  133. run/
  134. scheduler/
  135. secretmanager/
  136. securesourcemanager/
  137. security/
  138. securitycenter/
  139. securitycentermanagement/
  140. securityposture/
  141. servicecontrol/
  142. servicedirectory/
  143. servicehealth/
  144. servicemanagement/
  145. serviceusage/
  146. shell/
  147. shopping/
  148. spanner/
  149. speech/
  150. storage/
  151. storageinsights/
  152. storagetransfer/
  153. streetview/
  154. support/
  155. talent/
  156. telcoautomation/
  157. texttospeech/
  158. third_party/
  159. tpu/
  160. trace/
  161. translate/
  162. vertexai/
  163. video/
  164. videointelligence/
  165. vision/
  166. visionai/
  167. vmmigration/
  168. vmwareengine/
  169. vpcaccess/
  170. webrisk/
  171. websecurityscanner/
  172. workflows/
  173. workstations/
  174. .gitignore
  175. .release-please-manifest-individual.json
  176. .release-please-manifest-submodules.json
  177. .release-please-manifest.json
  178. CHANGES.md
  179. CODE_OF_CONDUCT.md
  180. CONTRIBUTING.md
  181. debug.md
  182. doc.go
  183. go.mod
  184. go.sum
  185. go.work
  186. go.work.sum
  187. LICENSE
  188. migration.md
  189. README.md
  190. release-please-config-individual.json
  191. release-please-config-yoshi-submodules.json
  192. release-please-config.json
  193. RELEASING.md
  194. SECURITY.md
  195. testing.md
README.md

Google Cloud Client Libraries for Go

Go Reference

Go packages for Google Cloud Platform services.

Installation

go get cloud.google.com/go/firestore@latest # Replace firestore with the package you want to use.

NOTE: Some of these packages are under development, and may occasionally make backwards-incompatible changes.

Supported APIs

For an updated list of all of our released APIs please see our reference docs.

Go Versions Supported

Our libraries are compatible with the two most recent major Go releases, the same policy the Go programming language follows. This means the currently supported versions are:

  • Go 1.22
  • Go 1.23

Authorization

By default, each API will use Google Application Default Credentials for authorization credentials used in calling the API endpoints. This will allow your application to run in many environments without requiring explicit configuration.

client, err := storage.NewClient(ctx)

To authorize using a JSON key file, pass option.WithCredentialsFile to the NewClient function of the desired package. For example:

client, err := storage.NewClient(ctx, option.WithCredentialsFile("path/to/keyfile.json"))

You can exert more control over authorization by using the credentials package to create an auth.Credentials. Then pass option.WithAuthCredentials to the NewClient function:

creds := ...
client, err := storage.NewClient(ctx, option.WithAuthCredentials(creds))

Contributing

Contributions are welcome. Please, see the CONTRIBUTING document for details.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See Contributor Code of Conduct for more information.

Links