gcpen

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 3 Imported by: 3

README

gcpen

Utilities related to GCP environment variables(GC🖋)

Documentation

Index

Constants

View Source
const (
	EnvKeyProjectID          = "GCP_PROJECT"          // for Google Cloud Functions
	EnvKeyGoogleCloudProject = "GOOGLE_CLOUD_PROJECT" // for Google App Engine

	// EnvKeyServiceName will be deleted in a major version upgrade
	// Deprecated
	EnvKeyServiceName = "GAE_SERVICE" // for Google App Engine
	// EnvKeyServiceVersion will be deleted in a major version upgrade
	// Deprecated
	EnvKeyServiceVersion = "GAE_VERSION" // for Google App Engine

	EnvKeyGAEServiceName     = "GAE_SERVICE" // for Google App Engine
	EnvKeyGAEServiceVersion  = "GAE_VERSION" // for Google App Engine
	EnvKeyRUNServiceName     = "K_SERVICE"   // for Google Cloud Run
	EnvKeyRUNServiceRevision = "K_REVISION"  // for Google Cloud Run
)

Variables

View Source
var (
	// ProjectID - Google Cloud Platform Project ID
	ProjectID = getProjectID()

	// ServiceName - Google App Engine service name
	// Deprecated
	ServiceName = os.Getenv(EnvKeyServiceName)

	// ServiceVersion - Google App Engine service version
	// Deprecated
	ServiceVersion = os.Getenv(EnvKeyServiceVersion)

	// GAEServiceName - Google App Engine service name
	GAEServiceName = os.Getenv(EnvKeyGAEServiceName)
	// GAEServiceVersion - Google App Engine service version
	GAEServiceVersion = os.Getenv(EnvKeyGAEServiceVersion)
	// RUNServiceName - Google Cloud Run service name
	RUNServiceName = os.Getenv(EnvKeyRUNServiceName)
	// RUNServiceRevision - Google Cloud Run service revision
	RUNServiceRevision = os.Getenv(EnvKeyRUNServiceRevision)
)

Functions

func GetProjectNumber

func GetProjectNumber(ctx context.Context, forceRefresh ...bool) (int64, error)

GetProjectNumber - get project number

func Reload

func Reload()

Reload - reload environment variables.

Types

This section is empty.

Jump to

Keyboard shortcuts

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