Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InDebugging ¶ added in v1.6.3
func InDebugging() bool
InDebugging return the status if cmdr was built with debug mode / or the app running under a debugger attached.
To enable the debugger attached mode for cmdr, run `go build` with `-tags=delve` options. eg:
go run -tags=delve ./cli go build -tags=delve -o my-app ./cli
For Goland, you can enable this under 'Run/Debug Configurations', by adding the following into 'Go tool arguments:'
-tags=delve
InDebugging() is a synonym to IsDebuggerAttached().
NOTE that `isdelve` algor is from https://stackoverflow.com/questions/47879070/how-can-i-see-if-the-goland-debugger-is-running-in-the-program
noinspection GoBoolExpressions
func InDevelopingTime ¶ added in v1.6.3
func InDevelopingTime() (status bool)
InDevelopingTime detects whether is in developing time.
If the main program has been built as an executable binary, we would assume which is not in developing time.
If log.GetDebugMode() is true, that's in developing time too.
func InDocker ¶
func InDocker() bool
InDocker detects if the service is running under docker environment.
InDocker test these two conditions: 1. find if `/.dockerenv` exists or not. 2. `docker` in buildtags
func InDockerEnvSimple ¶ added in v1.6.3
func InDockerEnvSimple() (status bool)
InDockerEnvSimple detects whether is running within docker container environment.
InDockerEnvSimple finds if `/.dockerenv` exists or not.
func InIstio ¶
func InIstio() bool
InIstio detects if the service is running under istio injected.
IMPORTANT ¶
To make this detector work properly, you must mount a DownwordAPI volume to your container/pod. See also: https://kubernetes.io/en/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/
func InTesting ¶ added in v1.6.3
func InTesting() bool
InTesting detects whether is running under go test mode
func InTestingT ¶ added in v1.6.5
InTestingT detects whether is running under 'go test' mode
func IsDebuggerAttached ¶ added in v1.6.3
func IsDebuggerAttached() bool
IsDebuggerAttached return the status if cmdr was built with debug mode / or the app running under a debugger attached.
To enable the debugger attached mode for cmdr, run `go build` with `-tags=delve` options. eg:
go run -tags=delve ./cli go build -tags=delve -o my-app ./cli
For Goland, you can enable this under 'Run/Debug Configurations', by adding the following into 'Go tool arguments:'
-tags=delve
IsDebuggerAttached() is a synonym to InDebugging().
NOTE that `isdelve` algor is from https://stackoverflow.com/questions/47879070/how-can-i-see-if-the-goland-debugger-is-running-in-the-program
noinspection GoBoolExpressions
Types ¶
This section is empty.