gcp

package
v0.0.0-...-5321e6f Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InClusterProjectID

func InClusterProjectID() (string, error)

InClusterProjectID returns the GCP project ID if the code is running inside a GKE cluster

func WaitForWorkloadIdentity

func WaitForWorkloadIdentity(maxWait time.Duration) error

WaitForWorkloadIdentity waits until the workload identity metadata server is ready. If the server is not ready within the specified timeout an error is returned.

Types

type SecretManagerClient

type SecretManagerClient struct {
	// contains filtered or unexported fields
}

func NewSecretManagerClient

func NewSecretManagerClient() (*SecretManagerClient, error)

NewSecretManagerClient opens a connection to the secret manager service.

func (*SecretManagerClient) Close

func (s *SecretManagerClient) Close()

Close closes the connection to the secret manager service.

func (*SecretManagerClient) GetSecret

func (s *SecretManagerClient) GetSecret(secret string) (string, error)

GetSecret accesses the given secret and returns its payload. The secret must be in the following format:

projects/<project-id>/secrets/<secret-name>/versions/<version-id>

Jump to

Keyboard shortcuts

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