ExRunTime v0.2.2 ExRunTime View Source
Tiny elixir library useful for examining the runtime environment.
Link to this section Summary
Functions
Examines the system environment variables to determine whether or not the application is running in Kubernetes.
Examines the system environment variables to determine whether or not the application is running in the production environment.
Examines the system environment variables to determine whether or not the application is running in test.
Link to this section Functions
is_kubernetes?(env \\ System.get_env()) View Source
Examines the system environment variables to determine whether or not the application is running in Kubernetes.
Returns true or false.
Uses System.get_env()
by default but you can pass in your own map.
Examples
iex> ExRunTime.is_kubernetes?(%{"KUBERNETES_POD" => "some-pod"})
true
iex> ExRunTime.is_kubernetes?(%{})
false
is_production_deploy?(env \\ System.get_env()) View Source
Examines the system environment variables to determine whether or not the application is running in the production environment.
Returns true or false.
Uses System.get_env()
by default but you can pass in your own map.
Examples
iex> ExRunTime.is_production_deploy?()
false
iex> ExRunTime.is_production_deploy?(%{})
false
iex> ExRunTime.is_production_deploy?(%{"DEPLOYED_ENV" => "test"})
false
iex> ExRunTime.is_production_deploy?(%{"DEPLOYED_ENV" => "prod"})
true
is_test?(env \\ System.get_env()) View Source
Examines the system environment variables to determine whether or not the application is running in test.
Returns true or false.
Uses System.get_env()
by default but you can pass in your own map.
Examples
iex> ExRunTime.is_test?()
false
iex> ExRunTime.is_test?(%{})
false
iex> ExRunTime.is_test?(%{"MIX_ENV" => "test"})
true
iex> ExRunTime.is_test?(%{"MIX_ENV" => "prod"})
false