detect

package
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package detect is used find information from the environment.

Index

Constants

View Source
const (
	// ProjectIDSentinel is the value that users should pass for the project ID
	// to enable detection.
	ProjectIDSentinel = "*detect-project-id*"
)

Variables

This section is empty.

Functions

func ProjectID

func ProjectID(ctx context.Context, projectID, emulatorEnvVar string, opts ...option.ClientOption) (string, error)

ProjectID tries to detect the project ID from the environment if the sentinel value, "*detect-project-id*", is sent. It looks in the following order:

  1. GOOGLE_CLOUD_PROJECT envvar
  2. ADC creds.ProjectID
  3. A static value if the environment is emulated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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