gcpshared

package
v2.16.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

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

func JoinProviderID(project, zone, instanceName string) string

JoinProviderID builds a k8s provider ID for GCP instances. A providerID is build after the schema 'gce://<project-id>/<zone>/<instance-name>'

func SplitProviderID

func SplitProviderID(providerID string) (project, zone, instance string, err error)

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.

Jump to

Keyboard shortcuts

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