package gcpcfg¶
Package gcpcfg holds the Google Cloud connection settings shared by state backends, encrypters, and Go libraries. Load resolves a Configuration into credentials and client settings.
Functions¶
func DefaultScopes¶
DefaultScopes returns the OAuth scopes used when a config does not set scopes explicitly.
Types¶
type Configuration¶
type Configuration struct {
Project *string
BillingProject *string
Region *string
Zone *string
CredentialsFile *string
ImpersonateServiceAccount *string
ImpersonateServiceAccountDelegates *[]string
Scopes *[]string
Endpoints *map[string]string
UserProjectOverride *bool
RequestReason *string
RequestTimeout *string
UniverseDomain *string
PreferRegionalEndpoints *bool
PreferGlobalEndpoints *bool
}
Configuration selects how a component reaches Google Cloud. Credentials come from Application Default Credentials, metadata credentials, or a credentials file path; inline tokens and private keys do not belong here.
func (*Configuration) ClientOptions¶
ClientOptions returns Google API client options for service.
func (Configuration) Defaults¶
Defaults declares schema defaults for source analysis.
func (*Configuration) Endpoint¶
Endpoint returns the endpoint configured for service.
func (*Configuration) KMSEndpoint¶
KMSEndpoint returns the Google Cloud KMS endpoint override.
func (*Configuration) ScopeValues¶
ScopeValues returns configured scopes, or the default scopes when absent.
func (*Configuration) StorageEndpoint¶
StorageEndpoint returns the Google Cloud Storage endpoint override.
func (*Configuration) Timeout¶
Timeout returns the request timeout duration.
func (*Configuration) Validate¶
Validate checks static configuration that can be rejected without network I/O.
type ResolvedConfig¶
type ResolvedConfig struct {
Project string
BillingProject string
Region string
Zone string
Credentials *auth.Credentials
TokenSource oauth2.TokenSource
Scopes []string
Endpoints map[string]string
UserProjectOverride bool
RequestReason string
RequestTimeout time.Duration
UniverseDomain string
PreferRegionalEndpoints bool
PreferGlobalEndpoints bool
}
ResolvedConfig contains resolved Google Cloud client settings and credentials.
func Load¶
Load builds a ResolvedConfig from c through Application Default Credentials and environment defaults. A nil c applies no explicit overrides.
func (*ResolvedConfig) ClientOptions¶
ClientOptions returns Google API client options for service.