Dagger.CurrentModule (dagger v1.0.0-beta.18)

Copy Markdown View Source

Reflective module API provided to functions at runtime.

Summary

Functions

The module's context directory loaded into the engine (plus any generated code that may have been created).

The dependencies of the module.

The generated files and directories made on top of the module source's context directory.

A unique identifier for this CurrentModule.

The name of the module being executed in

The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).

The path to the directory containing the module's source code, relative to the context directory.

Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.

Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.

Types

t()

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

Functions

context_directory(current_module)

@spec context_directory(t()) :: Dagger.Directory.t()

The module's context directory loaded into the engine (plus any generated code that may have been created).

It holds the module's source code and every other file the engine loaded for the module, at their paths relative to the context root. Use sourceSubpath to locate the source code in it.

dependencies(current_module)

@spec dependencies(t()) :: {:ok, [Dagger.Module.t()]} | {:error, term()}

The dependencies of the module.

generated_context_directory(current_module)

@spec generated_context_directory(t()) :: Dagger.Directory.t()

The generated files and directories made on top of the module source's context directory.

id(current_module)

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

A unique identifier for this CurrentModule.

name(current_module)

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

The name of the module being executed in

source(current_module)

@spec source(t()) :: Dagger.Directory.t()

The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).

source_subpath(current_module)

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

The path to the directory containing the module's source code, relative to the context directory.

workdir(current_module, path, optional_args \\ [])

@spec workdir(t(), String.t(),
  exclude: [String.t()],
  include: [String.t()],
  gitignore: boolean() | nil
) ::
  Dagger.Directory.t()

Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.

workdir_file(current_module, path)

@spec workdir_file(t(), String.t()) :: Dagger.File.t()

Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.