package option

Import Path
	google.golang.org/api/option (on go.dev)

Dependency Relation
	imports 7 packages, and imported by 18 packages

Involved Source Files credentials_go19.go Package option contains options for Google API clients.
Package-Level Type Names (total 21, in which 2 are exported)
/* sort exporteds by: | */
ClientCertSource is a function that returns a TLS client certificate to be used when opening TLS connections. It follows the same semantics as crypto/tls.Config.GetClientCertificate. This is an EXPERIMENTAL API and may be changed or removed in the future.
A ClientOption is an option for a Google API client. ( T) Apply(*internal.DialSettings) func ImpersonateCredentials(target string, delegates ...string) ClientOption func WithAPIKey(apiKey string) ClientOption func WithAudiences(audience ...string) ClientOption func WithClientCertSource(s ClientCertSource) ClientOption func WithCredentials(creds *google.Credentials) ClientOption func WithCredentialsFile(filename string) ClientOption func WithCredentialsJSON(p []byte) ClientOption func WithEndpoint(url string) ClientOption func WithGRPCConn(conn *grpc.ClientConn) ClientOption func WithGRPCConnectionPool(size int) ClientOption func WithGRPCDialOption(opt grpc.DialOption) ClientOption func WithHTTPClient(client *http.Client) ClientOption func WithoutAuthentication() ClientOption func WithQuotaProject(quotaProject string) ClientOption func WithRequestReason(requestReason string) ClientOption func WithScopes(scope ...string) ClientOption func WithServiceAccountFile(filename string) ClientOption func WithTelemetryDisabled() ClientOption func WithTokenSource(s oauth2.TokenSource) ClientOption func WithUserAgent(ua string) ClientOption func google.golang.org/api/option/internaloption.SkipDialSettingsValidation() ClientOption func google.golang.org/api/option/internaloption.WithDefaultEndpoint(url string) ClientOption func google.golang.org/api/option/internaloption.WithDefaultMTLSEndpoint(url string) ClientOption func google.golang.org/api/idtoken.WithCredentialsFile(filename string) idtoken.ClientOption func google.golang.org/api/idtoken.WithCredentialsJSON(p []byte) idtoken.ClientOption func google.golang.org/api/idtoken.WithCustomClaims(customClaims map[string]interface{}) idtoken.ClientOption func google.golang.org/api/idtoken.WithHTTPClient(client *http.Client) idtoken.ClientOption func google.golang.org/api/transport/grpc.WithConnPool(p grpc.ConnPool) ClientOption func google.golang.org/api/idtoken.NewClient(ctx context.Context, audience string, opts ...idtoken.ClientOption) (*http.Client, error) func google.golang.org/api/idtoken.NewTokenSource(ctx context.Context, audience string, opts ...idtoken.ClientOption) (oauth2.TokenSource, error) func google.golang.org/api/idtoken.NewValidator(ctx context.Context, opts ...idtoken.ClientOption) (*idtoken.Validator, error) func google.golang.org/api/storage/v1.NewService(ctx context.Context, opts ...ClientOption) (*storage.Service, error) func google.golang.org/api/transport.Creds(ctx context.Context, opts ...ClientOption) (*google.Credentials, error) func google.golang.org/api/transport.DialGRPC(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error) func google.golang.org/api/transport.DialGRPCInsecure(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error) func google.golang.org/api/transport.NewHTTPClient(ctx context.Context, opts ...ClientOption) (*http.Client, string, error) func google.golang.org/api/transport/grpc.Dial(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error) func google.golang.org/api/transport/grpc.DialInsecure(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error) func google.golang.org/api/transport/grpc.DialPool(ctx context.Context, opts ...ClientOption) (grpc.ConnPool, error) func google.golang.org/api/transport/http.NewClient(ctx context.Context, opts ...ClientOption) (*http.Client, string, error) func google.golang.org/api/transport/http.NewTransport(ctx context.Context, base http.RoundTripper, opts ...ClientOption) (http.RoundTripper, error) func cloud.google.com/go/cloudtasks/apiv2.NewClient(ctx context.Context, opts ...ClientOption) (*cloudtasks.Client, error) func cloud.google.com/go/container/apiv1.NewClusterManagerClient(ctx context.Context, opts ...ClientOption) (*container.ClusterManagerClient, error) func cloud.google.com/go/errorreporting.NewClient(ctx context.Context, projectID string, cfg errorreporting.Config, opts ...ClientOption) (*errorreporting.Client, error) func cloud.google.com/go/errorreporting/apiv1beta1.NewErrorGroupClient(ctx context.Context, opts ...ClientOption) (*errorreporting.ErrorGroupClient, error) func cloud.google.com/go/errorreporting/apiv1beta1.NewErrorStatsClient(ctx context.Context, opts ...ClientOption) (*errorreporting.ErrorStatsClient, error) func cloud.google.com/go/errorreporting/apiv1beta1.NewReportErrorsClient(ctx context.Context, opts ...ClientOption) (*errorreporting.ReportErrorsClient, error) func cloud.google.com/go/logging.NewClient(ctx context.Context, parent string, opts ...ClientOption) (*logging.Client, error) func cloud.google.com/go/logging/apiv2.NewClient(ctx context.Context, opts ...ClientOption) (*logging.Client, error) func cloud.google.com/go/logging/apiv2.NewConfigClient(ctx context.Context, opts ...ClientOption) (*logging.ConfigClient, error) func cloud.google.com/go/logging/apiv2.NewMetricsClient(ctx context.Context, opts ...ClientOption) (*logging.MetricsClient, error) func cloud.google.com/go/monitoring/apiv3.NewAlertPolicyClient(ctx context.Context, opts ...ClientOption) (*monitoring.AlertPolicyClient, error) func cloud.google.com/go/monitoring/apiv3.NewGroupClient(ctx context.Context, opts ...ClientOption) (*monitoring.GroupClient, error) func cloud.google.com/go/monitoring/apiv3.NewMetricClient(ctx context.Context, opts ...ClientOption) (*monitoring.MetricClient, error) func cloud.google.com/go/monitoring/apiv3.NewNotificationChannelClient(ctx context.Context, opts ...ClientOption) (*monitoring.NotificationChannelClient, error) func cloud.google.com/go/monitoring/apiv3.NewServiceMonitoringClient(ctx context.Context, opts ...ClientOption) (*monitoring.ServiceMonitoringClient, error) func cloud.google.com/go/monitoring/apiv3.NewUptimeCheckClient(ctx context.Context, opts ...ClientOption) (*monitoring.UptimeCheckClient, error) func cloud.google.com/go/profiler.Start(cfg profiler.Config, options ...ClientOption) error func cloud.google.com/go/secretmanager/apiv1.NewClient(ctx context.Context, opts ...ClientOption) (*secretmanager.Client, error) func cloud.google.com/go/storage.NewClient(ctx context.Context, opts ...ClientOption) (*storage.Client, error) func cloud.google.com/go/trace/apiv2.NewClient(ctx context.Context, opts ...ClientOption) (*trace.Client, error)
Package-Level Functions (total 20, all are exported)
ImpersonateCredentials returns a ClientOption that will impersonate the target service account. In order to impersonate the target service account the base service account must have the Service Account Token Creator role, roles/iam.serviceAccountTokenCreator, on the target service account. See https://cloud.google.com/iam/docs/understanding-service-accounts. Optionally, delegates can be used during impersonation if the base service account lacks the token creator role on the target. When using delegates, each service account must be granted roles/iam.serviceAccountTokenCreator on the next service account in the chain. For example, if a base service account of SA1 is trying to impersonate target service account SA2 while using delegate service accounts DSA1 and DSA2, the following must be true: 1. Base service account SA1 has roles/iam.serviceAccountTokenCreator on DSA1. 2. DSA1 has roles/iam.serviceAccountTokenCreator on DSA2. 3. DSA2 has roles/iam.serviceAccountTokenCreator on target SA2. The resulting impersonated credential will either have the default scopes of the client being instantiating or the scopes from WithScopes if provided. Scopes are required for creating impersonated credentials, so if this option is used while not using a NewClient/NewService function, WithScopes must also be explicitly passed in as well. If the base credential is an authorized user and not a service account, or if the option WithQuotaProject is set, the target service account must have a role that grants the serviceusage.services.use permission such as roles/serviceusage.serviceUsageConsumer. This is an EXPERIMENTAL API and may be changed or removed in the future.
WithAPIKey returns a ClientOption that specifies an API key to be used as the basis for authentication. API Keys can only be used for JSON-over-HTTP APIs, including those under the import path google.golang.org/api/....
WithAudiences returns a ClientOption that specifies an audience to be used as the audience field ("aud") for the JWT token authentication.
WithClientCertSource returns a ClientOption that specifies a callback function for obtaining a TLS client certificate. This option is used for supporting mTLS authentication, where the server validates the client certifcate when establishing a connection. The callback function will be invoked whenever the server requests a certificate from the client. Implementations of the callback function should try to ensure that a valid certificate can be repeatedly returned on demand for the entire life cycle of the transport client. If a nil Certificate is returned (i.e. no Certificate can be obtained), an error should be returned. This is an EXPERIMENTAL API and may be changed or removed in the future.
WithCredentials returns a ClientOption that authenticates API calls.
WithCredentialsFile returns a ClientOption that authenticates API calls with the given service account or refresh token JSON credentials file.
WithCredentialsJSON returns a ClientOption that authenticates API calls with the given service account or refresh token JSON credentials.
WithEndpoint returns a ClientOption that overrides the default endpoint to be used for a service.
WithGRPCConn returns a ClientOption that specifies the gRPC client connection to use as the basis of communications. This option may only be used with services that support gRPC as their communication transport. When used, the WithGRPCConn option takes precedent over all other supplied options.
WithGRPCConnectionPool returns a ClientOption that creates a pool of gRPC connections that requests will be balanced between. This is an EXPERIMENTAL API and may be changed or removed in the future.
WithGRPCDialOption returns a ClientOption that appends a new grpc.DialOption to an underlying gRPC dial. It does not work with WithGRPCConn.
WithHTTPClient returns a ClientOption that specifies the HTTP client to use as the basis of communications. This option may only be used with services that support HTTP as their communication transport. When used, the WithHTTPClient option takes precedent over all other supplied options.
WithoutAuthentication returns a ClientOption that specifies that no authentication should be used. It is suitable only for testing and for accessing public resources, like public Google Cloud Storage buckets. It is an error to provide both WithoutAuthentication and any of WithAPIKey, WithTokenSource, WithCredentialsFile or WithServiceAccountFile.
WithQuotaProject returns a ClientOption that specifies the project used for quota and billing purposes. For more information please read: https://cloud.google.com/apis/docs/system-parameters
WithRequestReason returns a ClientOption that specifies a reason for making the request, which is intended to be recorded in audit logging. An example reason would be a support-case ticket number. For more information please read: https://cloud.google.com/apis/docs/system-parameters
WithScopes returns a ClientOption that overrides the default OAuth2 scopes to be used for a service.
WithServiceAccountFile returns a ClientOption that uses a Google service account credentials file to authenticate. Deprecated: Use WithCredentialsFile instead.
WithTelemetryDisabled returns a ClientOption that disables default telemetry (OpenCensus) settings on gRPC and HTTP clients. An example reason would be to bind custom telemetry that overrides the defaults.
WithTokenSource returns a ClientOption that specifies an OAuth2 token source to be used as the basis for authentication.
WithUserAgent returns a ClientOption that sets the User-Agent.