internal
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package internal supports the options and transport packages.
Package internal supports the options and transport packages.
Index¶
- Constants
- func AuthCreds(ctx context.Context, settings *DialSettings) (*auth.Credentials, error)
- func Creds(ctx context.Context, ds *DialSettings) (*google.Credentials, error)
- func GetGRPCTransportConfigAndEndpoint(settings *DialSettings) (credentials.TransportCredentials, string, error)
- func GetHTTPTransportConfigAndEndpoint(settings *DialSettings) (cert.Source, func(context.Context, string, string) (net.Conn, error), string, ...)
- func GetOAuth2Configuration(ctx context.Context, settings *DialSettings) (string, *http.Client, error)
- func GetQuotaProject(creds *google.Credentials, clientOpt string) string
- func GetS2AAddress() string
- func GetUniverseDomain(creds *google.Credentials) (string, error)
- type ConnPool
- type DialSettings
- func (ds *DialSettings) GetAudience() string
- func (ds *DialSettings) GetDefaultUniverseDomain() string
- func (ds *DialSettings) GetScopes() []string
- func (ds *DialSettings) GetUniverseDomain() string
- func (ds *DialSettings) HasCustomAudience() bool
- func (ds *DialSettings) IsNewAuthLibraryEnabled() bool
- func (ds *DialSettings) IsUniverseDomainGDU() bool
- func (ds *DialSettings) Validate() error
Constants¶
const Version = "0.257.0"Version is the current tagged release of the library.
Variables¶
This section is empty.
Functions¶
funcAuthCreds¶added inv0.210.0
func AuthCreds(ctxcontext.Context, settings *DialSettings) (*auth.Credentials,error)
AuthCreds returnscloud.google.com/go/auth.Credentials based on credentialsoptions provided via [option.ClientOption], including legacy oauth2/googleoptions. If there are no applicable options, then it returns the result ofcloud.google.com/go/auth/credentials.DetectDefault.Note: If NoAuth is true, whengoogle.golang.org/api/option.WithoutAuthenticationis passed, then no authentication will be performed and this function willreturn nil, nil.
funcCreds¶
func Creds(ctxcontext.Context, ds *DialSettings) (*google.Credentials,error)
Creds returns credential information obtained from DialSettings, or if none, thenit returns default credential information.
funcGetGRPCTransportConfigAndEndpoint¶added inv0.117.0
func GetGRPCTransportConfigAndEndpoint(settings *DialSettings) (credentials.TransportCredentials,string,error)
GetGRPCTransportConfigAndEndpoint returns an instance of credentials.TransportCredentials, and thecorresponding endpoint to use for GRPC client.
funcGetHTTPTransportConfigAndEndpoint¶added inv0.117.0
func GetHTTPTransportConfigAndEndpoint(settings *DialSettings) (cert.Source, func(context.Context,string,string) (net.Conn,error),string,error)
GetHTTPTransportConfigAndEndpoint returns a client certificate source, a function for dialing MTLS with S2A,and the endpoint to use for HTTP client.
funcGetOAuth2Configuration¶added inv0.184.0
func GetOAuth2Configuration(ctxcontext.Context, settings *DialSettings) (string, *http.Client,error)
GetOAuth2Configuration determines configurations for the OAuth2 transport, which is separate from the API transport.The OAuth2 transport and endpoint will be configured for mTLS if applicable.
funcGetQuotaProject¶added inv0.113.0
func GetQuotaProject(creds *google.Credentials, clientOptstring)string
GetQuotaProject retrieves quota project with precedence being: client option,environment variable, creds file.
funcGetS2AAddress¶added inv0.117.0
func GetS2AAddress()string
GetS2AAddress returns the S2A address to be reached via plaintext connection.
funcGetUniverseDomain¶added inv0.162.0
func GetUniverseDomain(creds *google.Credentials) (string,error)
GetUniverseDomain returns the default service domain for a given Clouduniverse, from google.Credentials. This wrapper function should be removedto closehttps://github.com/googleapis/google-api-go-client/issues/2399.
Types¶
typeConnPool¶added inv0.17.0
type ConnPool interface {// Conn returns a ClientConn from the pool.//// Conns aren't returned to the pool.Conn() *grpc.ClientConn// Num returns the number of connections in the pool.//// It will always return the same value.Num()int// Close closes every ClientConn in the pool.//// The error returned by Close may be a single error or multiple errors.Close()error// ConnPool implements grpc.ClientConnInterface to enable it to be used directly with generated proto stubs.grpc.ClientConnInterface}ConnPool is a pool of grpc.ClientConns.
typeDialSettings¶
type DialSettings struct {EndpointstringDefaultEndpointstringDefaultEndpointTemplatestringDefaultMTLSEndpointstringScopes []stringDefaultScopes []stringEnableJwtWithScopeboolTokenSourceoauth2.TokenSourceCredentials *google.CredentialsCredentialsFilestring// if set, Token Source is ignored.CredentialsJSON []byteInternalCredentials *google.CredentialsUserAgentstringAPIKeystringAudiences []stringDefaultAudiencestringHTTPClient *http.ClientGRPCDialOpts []grpc.DialOptionGRPCConn *grpc.ClientConnGRPCConnPoolConnPoolGRPCConnPoolSizeintNoAuthboolTelemetryDisabledboolClientCertSource func(*tls.CertificateRequestInfo) (*tls.Certificate,error)CustomClaims map[string]interface{}SkipValidationboolImpersonationConfig *impersonate.ConfigEnableDirectPathboolEnableDirectPathXdsboolAllowNonDefaultServiceAccountboolDefaultUniverseDomainstringUniverseDomainstringAllowHardBoundTokens []stringLogger *slog.Logger// Google API system parameters. For more information please read://https://cloud.google.com/apis/docs/system-parametersQuotaProjectstringRequestReasonstring// New Auth library OptionsAuthCredentials *auth.CredentialsEnableNewAuthLibrarybool// TODO(b/372244283): Remove after b/358175516 has been fixedEnableAsyncRefreshDryRun func()}DialSettings holds information needed to establish a connection with aGoogle API service.
func (*DialSettings)GetAudience¶added inv0.49.0
func (ds *DialSettings) GetAudience()string
GetAudience returns the user-provided audience, if set, or else falls back to the default audience.
func (*DialSettings)GetDefaultUniverseDomain¶added inv0.158.0
func (ds *DialSettings) GetDefaultUniverseDomain()string
GetDefaultUniverseDomain returns the Google default universe domain("googleapis.com").
func (*DialSettings)GetScopes¶added inv0.36.0
func (ds *DialSettings) GetScopes() []string
GetScopes returns the user-provided scopes, if set, or else falls back to thedefault scopes.
func (*DialSettings)GetUniverseDomain¶added inv0.158.0
func (ds *DialSettings) GetUniverseDomain()string
GetUniverseDomain returns the default service domain for a given Clouduniverse, with the following precedence:
1. A non-empty option.WithUniverseDomain.2. A non-empty environment variable GOOGLE_CLOUD_UNIVERSE_DOMAIN.3. The default value "googleapis.com".
func (*DialSettings)HasCustomAudience¶added inv0.49.0
func (ds *DialSettings) HasCustomAudience()bool
HasCustomAudience returns true if a custom audience is provided by users.
func (*DialSettings)IsNewAuthLibraryEnabled¶added inv0.142.0
func (ds *DialSettings) IsNewAuthLibraryEnabled()bool
IsNewAuthLibraryEnabled returns true if the new auth library should be used.
func (*DialSettings)IsUniverseDomainGDU¶added inv0.158.0
func (ds *DialSettings) IsUniverseDomainGDU()bool
IsUniverseDomainGDU returns true if the universe domain is the default Googleuniverse ("googleapis.com").
func (*DialSettings)Validate¶
func (ds *DialSettings) Validate()error
Validate reports an error if ds is invalid.
Directories¶
| Path | Synopsis |
|---|---|
Package cert contains certificate tools for Google API clients. | Package cert contains certificate tools for Google API clients. |
examples | |
fake Package fake demonstrates how to use concrete services and fake the interactions with them in tests. | Package fake demonstrates how to use concrete services and fake the interactions with them in tests. |
mock Package mock demonstrates how to use interfaces to mock interactions with service in tests. | Package mock demonstrates how to use interfaces to mock interactions with service in tests. |
Package gensupport is an internal implementation detail used by code generated by the google-api-go-generator tool. | Package gensupport is an internal implementation detail used by code generated by the google-api-go-generator tool. |
Package impersonate is used to impersonate Google Credentials. | Package impersonate is used to impersonate Google Credentials. |
kokoro | |
discogenmodule | |
third_party | |
uritemplates Package uritemplates is a level 3 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570). | Package uritemplates is a level 3 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570). |