utils

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 5 Imported by: 21

Documentation

Index

Constants

View Source
const (

	// ProjectIDEnvKey is the name of environmental variable for project ID
	ProjectIDEnvKey = "PROJECT_ID"
)

Variables

This section is empty.

Functions

func Base64ToMap

func Base64ToMap(base64 string) (map[string]string, error)

func ClusterName added in v0.15.0

func ClusterName(clusterName string, client metadataClient.Client) (string, error)

ClusterName returns the cluster name for a particular resource.

func MapToBase64

func MapToBase64(extensions map[string]string) (string, error)

func ProjectIDOrDefault added in v0.19.0

func ProjectIDOrDefault(projectID string) (string, error)

ProjectIDOrDefault returns the project ID by performing the following order: 1) if the input project ID is valid, simply use it. 2) if there is a PROJECT_ID environmental variable, use it. 3) use metadataClient to resolve project id.

Types

type ProjectIDEnvConfig added in v0.19.0

type ProjectIDEnvConfig struct {
	ProjectID string `envconfig:"PROJECT_ID"`
}

ProjectIDEnvConfig is a struct to parse project ID from env var

Directories

Path Synopsis
Package appcredentials provides utilities for the application credentials used to access GCP services.
Package appcredentials provides utilities for the application credentials used to access GCP services.
Package authcheck provides utilities to check authentication configuration for data plane resources.
Package authcheck provides utilities to check authentication configuration for data plane resources.
Package mainhelper provides helper functions for common boilerplate code in writing a main function such as setting up kube informers.
Package mainhelper provides helper functions for common boilerplate code in writing a main function such as setting up kube informers.

Jump to

Keyboard shortcuts

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