commit | fafaf0d0a293096559a4655ea61062cb896f1568 | [log] [tgz] |
---|---|---|
author | Egon Elbre <egonelbre@gmail.com> | Fri May 03 22:54:17 2024 +0300 |
committer | GitHub <noreply@github.com> | Fri May 03 19:54:17 2024 +0000 |
tree | 611bbe62287b1cc747b32b6c24dd87f1ee01e59f | |
parent | 63f947d78a726001e0b176599ffc503447b25d78 [diff] |
fix(internal/aliasfix): handle import paths correctly (#10097) The last component in import path of the old genproto path does not correspond to the import path -- usually. The import paths usually look like `google.golang.org/genproto/googleapis/analytics/admin/v1alpha`, however the imported package name is `admin`. This uses a heuristic to detect whether the last path component is a version, There are some packages that do not fit that description though, e.g. `google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/grafeas`.
Go packages for Google Cloud Platform services.
import "cloud.google.com/go"
To install the packages on your system, do not clone the repo. Instead:
cd /my/cloud/project
go get
the package(s) you want to use:go get cloud.google.com/go/firestore # Replace with the package you want to use.
NOTE: Some of these packages are under development, and may occasionally make backwards-incompatible changes.
For an updated list of all of our released APIs please see our reference docs.
Our libraries are compatible with at least the three most recent, major Go releases. They are currently compatible with:
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 golang.org/x/oauth2
package to create an oauth2.TokenSource
. Then pass option.WithTokenSource
to the NewClient
function:
tokenSource := ...
client, err := storage.NewClient(ctx, option.WithTokenSource(tokenSource))
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.