gcpopts

package
v2.40.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: Apache-2.0, BSD-3-Clause, MIT Imports: 8 Imported by: 3

Documentation

Overview

Package gcpopts contains shared options for Google Cloud Platform.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Project is the Google Cloud Platform project ID.
	Project = flag.String("project", "", "Google Cloud Platform project ID.")

	// Region is the GCP region where the job should be run.
	Region = flag.String("region", "", "GCP Region (required)")
)

Functions

func GetProject

func GetProject(ctx context.Context) string

GetProject returns the project, if non empty and exits otherwise. Convenience function.

func GetProjectFromFlagOrEnvironment added in v2.37.0

func GetProjectFromFlagOrEnvironment(ctx context.Context) string

GetProjectFromFlagOrEnvironment gets the project first via flag then falling back to https://cloud.google.com/docs/authentication/production#auth-cloud-explicit-go

func GetRegion

func GetRegion(ctx context.Context) string

GetRegion returns the region first via flag then falling back to https://cloud.google.com/compute/docs/gcloud-compute/#default-properties.

Types

This section is empty.

Jump to

Keyboard shortcuts

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