gcputil

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package gcputil exposes helpers for interacting with Google Cloud.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProjectID

func ProjectID(ctx context.Context) string

ProjectID attempts to get the project ID, starting with the fastest resolution ($PROJECT_ID, $GOOGLE_PROJECT, $GOOGLE_CLOUD_PROJECT) and then evetually querying the metadata server. If it fails to find a project ID, it logs an error.

The results are not cached and could result in outbound HTTP calls. As such, callers should cache the response since it is unlikely to change.

Types

This section is empty.

Jump to

Keyboard shortcuts

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