Documentation ¶
Overview ¶
Package gcpshared contains code to parse and define data types relevant for Google Cloud Platform.
This package is intended to have a minimal size and surface. If you have GCP related code that is not shared by multiple applications, or if the code interacts with the GCP API, please keep the code in the application's internal package or add it to the GCP cloud package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinProviderID ¶
JoinProviderID builds a k8s provider ID for GCP instances. A providerID is build after the schema 'gce://<project-id>/<zone>/<instance-name>'
func SplitProviderID ¶
SplitProviderID splits a k8s provider ID for GCP instances into its core components. A provider ID is build after the schema 'gce://<project-id>/<zone>/<instance-name>'
Types ¶
type ServiceAccountKey ¶
type ServiceAccountKey struct { Type string `json:"type"` ProjectID string `json:"project_id"` PrivateKeyID string `json:"private_key_id"` PrivateKey string `json:"private_key"` ClientEmail string `json:"client_email"` ClientID string `json:"client_id"` AuthURI string `json:"auth_uri"` TokenURI string `json:"token_uri"` AuthProviderX509CertURL string `json:"auth_provider_x509_cert_url"` ClientX509CertURL string `json:"client_x509_cert_url"` }
ServiceAccountKey is a GCP service account key.
func ServiceAccountKeyFromURI ¶
func ServiceAccountKeyFromURI(serviceAccountURI string) (ServiceAccountKey, error)
ServiceAccountKeyFromURI parses ServiceAccountKey from URI.
func (ServiceAccountKey) ToCloudServiceAccountURI ¶
func (k ServiceAccountKey) ToCloudServiceAccountURI() string
ToCloudServiceAccountURI converts the ServiceAccountKey into a cloud service account URI.