Dagger.EnvFile (dagger v0.19.4)

View Source

A collection of environment variables.

Summary

Functions

Return as a file

Check if a variable exists

Lookup a variable (last occurrence wins) and return its value, or an empty string

A unique identifier for this EnvFile.

Filters variables by prefix and removes the pref from keys. Variables without the prefix are excluded. For example, with the prefix "MYAPP" and variables: MY_APP_TOKEN=topsecret MY_APP_NAME=hello FOO=bar the resulting environment will contain: TOKEN=topsecret NAME=hello

Remove all occurrences of the named variable

Types

t()

@type t() :: %Dagger.EnvFile{client: term(), query_builder: term()}

Functions

as_file(env_file)

@spec as_file(t()) :: Dagger.File.t()

Return as a file

exists(env_file, name)

@spec exists(t(), String.t()) :: {:ok, boolean()} | {:error, term()}

Check if a variable exists

get(env_file, name, optional_args \\ [])

@spec get(t(), String.t(), [{:raw, boolean() | nil}]) ::
  {:ok, String.t()} | {:error, term()}

Lookup a variable (last occurrence wins) and return its value, or an empty string

id(env_file)

@spec id(t()) :: {:ok, Dagger.EnvFileID.t()} | {:error, term()}

A unique identifier for this EnvFile.

namespace(env_file, prefix)

@spec namespace(t(), String.t()) :: t()

Filters variables by prefix and removes the pref from keys. Variables without the prefix are excluded. For example, with the prefix "MYAPP" and variables: MY_APP_TOKEN=topsecret MY_APP_NAME=hello FOO=bar the resulting environment will contain: TOKEN=topsecret NAME=hello

variables(env_file, optional_args \\ [])

@spec variables(t(), [{:raw, boolean() | nil}]) ::
  {:ok, [Dagger.EnvVariable.t()]} | {:error, term()}

Return all variables

with_variable(env_file, name, value)

@spec with_variable(t(), String.t(), String.t()) :: t()

Add a variable

without_variable(env_file, name)

@spec without_variable(t(), String.t()) :: t()

Remove all occurrences of the named variable