spaceship_helm/env

Types

Environment variable storage. This is populated by the platform shim at startup.

pub type Env {
  Env(vars: dynamic.Dynamic)
}

Constructors

Values

pub fn all() -> List(#(String, String))

Get all environment variables as a list of key-value pairs. Note: This depends on the platform implementation.

pub fn get(name: String) -> option.Option(String)

Get an environment variable by name. Returns None if the variable is not set.

pub fn get_global_env() -> option.Option(Env)

Get the global environment instance.

pub fn get_or(name: String, default: String) -> String

Get an environment variable by name with a default value. Returns the default if the variable is not set.

pub fn get_required(name: String) -> String

Get an environment variable by name, or panic if not set. Use this only for required environment variables.

pub fn has(name: String) -> Bool

Check if an environment variable is set.

pub fn init(vars: dynamic.Dynamic) -> Nil

Initialize the environment with platform-specific values. Called by the platform shim at startup.

pub fn set_global_env(env: Env) -> Nil

Set the global environment instance. Called by the platform shim at startup.

Search Document