MCPcopy
hub / github.com/grpc/grpc-go / NewComputeEngine

Function NewComputeEngine

credentials/oauth/oauth.go:148–150  ·  view source on GitHub ↗

NewComputeEngine constructs the PerRPCCredentials that fetches access tokens from Google Compute Engine (GCE)'s metadata server. It is only valid to use this if your program is running on a GCE instance. TODO(dsymonds): Deprecate and remove this.

()

Source from the content-addressed store, hash-verified

146// if your program is running on a GCE instance.
147// TODO(dsymonds): Deprecate and remove this.
148func NewComputeEngine() credentials.PerRPCCredentials {
149 return TokenSource{google.ComputeTokenSource("")}
150}
151
152// serviceAccount represents PerRPCCredentials via JWT signing key.
153type serviceAccount struct {

Callers 2

mainFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected