package detect

import "cloud.google.com/go/internal/detect"

Package detect is used find information from the environment.

Index

Functions

func ProjectID

func ProjectID(ctx context.Context, projectID string, 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.

Source Files

detect.go

Version
v0.99.0
Published
Dec 6, 2021
Platform
windows/amd64
Imports
7 packages
Last checked
41 minutes ago

Tools for package owners.