Documentation ¶
Overview ¶
Package gcpenv allows processes on GCP to do some introspection about what service they are running on.
Index ¶
Constants ¶
const ( CodeNot = "not_gcp" CodeGCE = "compute_engine" CodeGCF = "cloud_functions" CodeRun = "cloud_run" CodeGAE = "app_engine" CodeGKE = "kubernetes_engine" LabelNot = "Not GCP" LabelGCE = "Compute Engine" LabelGCF = "Cloud Functions" LabelRun = "Cloud Run" LabelGAE = "App Engine" LabelGKE = "Kubernetes Engine" )
Codes and strings for comparison in consuming apps
Variables ¶
This section is empty.
Functions ¶
func IsAppEngine ¶
func IsAppEngine() bool
IsAppEngine checks whether or not this process is running on App Engine
func IsCloudFunction ¶
func IsCloudFunction() bool
IsCloudFunction checks whether or not this process is running on Cloud Functions
func IsCloudRun ¶
func IsCloudRun() bool
IsCloudRun checks whether or not this process is running on Cloud Run
func IsComputeEngine ¶
func IsComputeEngine() bool
IsComputeEngine checks whether or not this process is running on Compute Engine
func IsDocker ¶
func IsDocker() bool
IsDocker checks whether or not this process is running on Docker
func IsKubernetes ¶
func IsKubernetes() bool
IsKubernetes checks whether or not this process is running on Kubernetes
Types ¶
type Report ¶
type Report struct { Project struct { ID string `json:"id"` Zone string `json:"zone"` Region string `json:"region"` } `json:"project"` Environment struct { Code string `json:"code"` Label string `json:"label"` } `json:"environment"` Products struct { AppEngine bool `json:"appengine"` ComputeEngine bool `json:"computeengine"` CloudRun bool `json:"cloudrun"` CloudFunctions bool `json:"cloudfunctions"` } `json:"products"` Environments struct { Kubernetes bool `json:"kubernetes"` Docker bool `json:"docker"` } `json:"environments"` Endpoint string `json:"endpoint"` }
Report is a set of products and environments for a given environment in GCP.