config

package
v1.151.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerConfig

type ControllerConfig struct {
	// UserAgent sets the User-Agent to pass in HTTP request headers
	UserAgent string

	// UserProjectOverride provides the option to use the resource project for preconditions, quota, and billing,
	// instead of the project the credentials belong to; false by default
	UserProjectOverride bool

	// BillingProject is the project used by the TF provider and DCL client to determine preconditions,
	// quota, and billing if UserProjectOverride is set to true. If this field is empty,
	// but UserProjectOverride is set to true, resource project will be used.
	BillingProject string

	// HTTPClient allows us to specify the HTTP client to use with DCL.
	// This is particularly useful in mocks/tests.
	HTTPClient *http.Client

	// GRPCUnaryClientInterceptor is the GRPC interceptor for use in tests.
	GRPCUnaryClientInterceptor grpc.UnaryClientInterceptor

	// GCPTokenSource mints OAuth2 tokens to be passed with GCP API calls,
	// allowing use of a non-default OAuth2 identity
	GCPTokenSource oauth2.TokenSource

	// EnableMetricsTransport enables automatic wrapping of HTTP clients with metrics transport
	EnableMetricsTransport bool

	// ProjectMapper maps between project ids and numbers
	ProjectMapper *projects.ProjectMapper

	// SkipNameValidation bypasses the duplicate controller name check during registration
	SkipNameValidation bool
}

func (*ControllerConfig) GRPCClientOptions added in v1.122.0

func (c *ControllerConfig) GRPCClientOptions() ([]option.ClientOption, error)

func (*ControllerConfig) Init added in v1.135.0

func (c *ControllerConfig) Init(ctx context.Context) error

func (*ControllerConfig) NewAuthenticatedHTTPClient added in v1.134.0

func (c *ControllerConfig) NewAuthenticatedHTTPClient(ctx context.Context) (*http.Client, error)

NewAuthenticatedHTTPClient creates an HTTP client with proper authentication and optionally wraps it with metrics transport

func (*ControllerConfig) RESTClientOptions added in v1.122.0

func (c *ControllerConfig) RESTClientOptions(options ...RESTClientOption) ([]option.ClientOption, error)

type RESTClientOption added in v1.143.0

type RESTClientOption func(o *restClientOptions)

func WithDefaultQuotaProject added in v1.143.0

func WithDefaultQuotaProject(project string) RESTClientOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL