MCPcopy Create free account
hub / github.com/google/go-cloud / CredentialsTokenSource

Function CredentialsTokenSource

gcp/gcp.go:102–107  ·  view source on GitHub ↗

CredentialsTokenSource extracts the token source from GCP credentials.

(creds *google.Credentials)

Source from the content-addressed store, hash-verified

100
101// CredentialsTokenSource extracts the token source from GCP credentials.
102func CredentialsTokenSource(creds *google.Credentials) TokenSource {
103 if creds == nil {
104 return nil
105 }
106 return TokenSource(creds.TokenSource)
107}
108
109// DefaultProjectID obtains the project ID from the default GCP credentials.
110func DefaultProjectID(creds *google.Credentials) (ProjectID, error) {

Callers 13

BenchmarkGcsblobFunction · 0.92
ExampleOpenBucketFunction · 0.92
setupGCPFunction · 0.92
TestNewHTTPClientFunction · 0.92
NewGCPClientFunction · 0.92
NewGCPgRPCConnFunction · 0.92
BenchmarkGcpPubSubFunction · 0.92
TestOpenTopicFunction · 0.92
TestOpenSubscriptionFunction · 0.92
BenchmarkGcpPubSubFunction · 0.92
TestOpenTopicFunction · 0.92

Calls 1

TokenSourceTypeAlias · 0.85

Tested by 10

BenchmarkGcsblobFunction · 0.74
ExampleOpenBucketFunction · 0.74
TestNewHTTPClientFunction · 0.74
BenchmarkGcpPubSubFunction · 0.74
TestOpenTopicFunction · 0.74
TestOpenSubscriptionFunction · 0.74
BenchmarkGcpPubSubFunction · 0.74
TestOpenTopicFunction · 0.74
TestOpenSubscriptionFunction · 0.74