Documentation
¶
Index ¶
- func IsAzureFunction() bool
- func IsCI() bool
- func IsCloudRun() bool
- func IsJenkins() bool
- func IsKubernetes() bool
- func IsLocal() bool
- func IsProduction() bool
- func MustRead(name string) string
- func MustReadJSON(name string, dest any)
- func OptionalRead(name string) string
- func ServiceName() string
- func Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAzureFunction ¶
func IsAzureFunction() bool
IsAzureFunction detects if we are running inside an Azure Function app.
func IsCloudRun ¶
func IsCloudRun() bool
IsCloudRun detects if we are running inside a Cloud Run app.
func IsJenkins ¶
func IsJenkins() bool
IsJenkins detects if we are running as a step of a Jenkins build.
func IsKubernetes ¶
func IsKubernetes() bool
IsKubernetes detects if we are running inside a Kubernetes pod.
func IsLocal ¶
func IsLocal() bool
IsLocal returns true if we are running inside a local debug environment instead of a production container. It dependes on Version() working correctly.
func IsProduction ¶ added in v0.3.0
func IsProduction() bool
IsProduction returns true if we are running inside a production environment. It depends on Version() working correctly.
func MustRead ¶
MustRead asserts an env variable exists and it is not empty. It reads its value. If the value starts with "base64://" it will be decoded as well before returning.
func MustReadJSON ¶ added in v0.1.0
MustReadJSON asserts an env variable exists and it is not empty. It reads its value and unmarshals it into the given destination. If the value starts with "base64://" it will be decoded as well before returning.
func OptionalRead ¶ added in v0.2.0
OptionalRead reads an env variable if it exists and it is not empty. It returns the value. If the value starts with "base64://" it will be decoded as well before returning.
func ServiceName ¶
func ServiceName() string
ServiceName returns the version of the application from the environment-dependent variables or the hostname if none is available.
Types ¶
This section is empty.