gcp

package
v0.1.0-beta.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Ctx       context.Context
	ProjectID string

	IAMClient                   *admin.IamClient
	CloudResourceManagerService *crm.Service
	GKEService                  *gke.Service
}

func (*Agent) CreateServiceAccount

func (a *Agent) CreateServiceAccount(name string) (*adminpb.ServiceAccount, error)

func (*Agent) CreateServiceAccountKey

func (a *Agent) CreateServiceAccountKey(sa *adminpb.ServiceAccount) ([]byte, error)

CreateServiceAccountKey will create a new key for the specified service account

func (*Agent) GetProjectIDForGKECluster

func (a *Agent) GetProjectIDForGKECluster(endpoint string) (string, error)

GetProjectIDForGKECluster automatically determines the project ID for a cluster that a user has access to

func (*Agent) SetServiceAccountIAMPolicy

func (a *Agent) SetServiceAccountIAMPolicy(sa *adminpb.ServiceAccount) error

type ServiceAccountKey

type ServiceAccountKey struct {
	// set to service_account
	Type         string `json:"type"`
	ProjectID    string `json:"project_id"`
	PrivateKeyID string `json:"private_key_id"`
	// the private key, not base64 encoded
	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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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