Documentation
¶
Overview ¶
Package detect provides functions to detect the environment the application is running in. It is intended to be used either in a main function or automatically used in a program calling init.Service().
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RunEnv ¶
type RunEnv struct {
// IsKubernetes is true if the application is running in a Kubernetes cluster.
IsKubernetes bool
// IsKind is true if the application is running in a Kind cluster.
IsKind bool
// Err is the error that occurred during the detection of the environment.
Err error
// IgnoreTesting is a flag to ignore if testing.Testing() is true for the purpose
// of .Prod() . Normally being in a test environment makes .Prod() return false. But if
// you are doing a test with a RunEnv and want Prod() to return true, set this to true.
// This only works in tests.
IgnoreTesting bool
// contains filtered or unexported fields
}
RunEnv details the environment the application is running in. TODO: Add more fields, like if we are running in other environments, CCP, underlay, ...
Click to show internal directories.
Click to hide internal directories.