View Source Dagger.ModuleSource (dagger v0.10.0)

The source needed to load and run a module, along with any metadata about the source such as versions/urls/etc.

Link to this section Summary

Functions

If the source is a of kind git, the git source representation of it.

If the source is of kind local, the local source representation of it.

Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation

A human readable ref string representation of this module source.

Returns whether the module source has a configuration file.

The directory containing everything needed to load load and use the module.

The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls.

The directory containing the module configuration and source code (source code may be in a subdir).

A unique identifier for this ModuleSource.

The kind of source (e.g. local, git, etc.)

If set, the name of the module this source references, including any overrides at runtime by callers.

The original name of the module this source references, as defined in the module configuration.

The path to the module source's context directory on the caller's filesystem. Only valid for local sources.

Resolve the provided module source arg as a dependency relative to this module source.

Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources.

The path relative to context of the root of the module source, which contains dagger.json. It also contains the module implementation source code, but that may or may not being a subdir of this root.

The path relative to context of the module implementation source code.

Update the module source with a new context directory. Only valid for local sources.

Append the provided dependencies to the module source's dependency list.

Update the module source with a new name.

Update the module source with a new SDK.

Update the module source with a new source subpath.

Link to this section Types

@type t() :: %Dagger.ModuleSource{client: term(), selection: term()}

Link to this section Functions

Link to this function

as_git_source(module_source)

View Source
@spec as_git_source(t()) :: {:ok, Dagger.GitModuleSource.t() | nil} | {:error, term()}

If the source is a of kind git, the git source representation of it.

Link to this function

as_local_source(module_source)

View Source
@spec as_local_source(t()) ::
  {:ok, Dagger.LocalModuleSource.t() | nil} | {:error, term()}

If the source is of kind local, the local source representation of it.

Link to this function

as_module(module_source)

View Source
@spec as_module(t()) :: Dagger.Module.t()

Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation

Link to this function

as_string(module_source)

View Source
@spec as_string(t()) :: {:ok, Dagger.String.t()} | {:error, term()}

A human readable ref string representation of this module source.

Link to this function

config_exists(module_source)

View Source
@spec config_exists(t()) :: {:ok, Dagger.Boolean.t()} | {:error, term()}

Returns whether the module source has a configuration file.

Link to this function

context_directory(module_source)

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

The directory containing everything needed to load load and use the module.

Link to this function

dependencies(module_source)

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

The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls.

Link to this function

directory(module_source, path)

View Source
@spec directory(t(), Dagger.String.t()) :: Dagger.Directory.t()

The directory containing the module configuration and source code (source code may be in a subdir).

required-arguments

Required Arguments

  • path - The path from the source directory to select.
@spec id(t()) :: {:ok, Dagger.ModuleSourceID.t()} | {:error, term()}

A unique identifier for this ModuleSource.

@spec kind(t()) :: {:ok, Dagger.ModuleSourceKind.t()} | {:error, term()}

The kind of source (e.g. local, git, etc.)

Link to this function

module_name(module_source)

View Source
@spec module_name(t()) :: {:ok, Dagger.String.t()} | {:error, term()}

If set, the name of the module this source references, including any overrides at runtime by callers.

Link to this function

module_original_name(module_source)

View Source
@spec module_original_name(t()) :: {:ok, Dagger.String.t()} | {:error, term()}

The original name of the module this source references, as defined in the module configuration.

Link to this function

resolve_context_path_from_caller(module_source)

View Source
@spec resolve_context_path_from_caller(t()) ::
  {:ok, Dagger.String.t()} | {:error, term()}

The path to the module source's context directory on the caller's filesystem. Only valid for local sources.

Link to this function

resolve_dependency(module_source, dep)

View Source
@spec resolve_dependency(t(), t()) :: t()

Resolve the provided module source arg as a dependency relative to this module source.

required-arguments

Required Arguments

  • dep - The dependency module source to resolve.
Link to this function

resolve_from_caller(module_source)

View Source
@spec resolve_from_caller(t()) :: t()

Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources.

Link to this function

source_root_subpath(module_source)

View Source
@spec source_root_subpath(t()) :: {:ok, Dagger.String.t()} | {:error, term()}

The path relative to context of the root of the module source, which contains dagger.json. It also contains the module implementation source code, but that may or may not being a subdir of this root.

Link to this function

source_subpath(module_source)

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

The path relative to context of the module implementation source code.

Link to this function

with_context_directory(module_source, dir)

View Source
@spec with_context_directory(t(), Dagger.Directory.t()) :: t()

Update the module source with a new context directory. Only valid for local sources.

required-arguments

Required Arguments

  • dir - The directory to set as the context directory.
Link to this function

with_dependencies(module_source, dependencies)

View Source
@spec with_dependencies(t(), [Dagger.ModuleDependencyID.t()]) :: t()

Append the provided dependencies to the module source's dependency list.

required-arguments

Required Arguments

  • dependencies - The dependencies to append.
Link to this function

with_name(module_source, name)

View Source
@spec with_name(t(), Dagger.String.t()) :: t()

Update the module source with a new name.

required-arguments

Required Arguments

  • name - The name to set.
Link to this function

with_sdk(module_source, sdk)

View Source
@spec with_sdk(t(), Dagger.String.t()) :: t()

Update the module source with a new SDK.

required-arguments

Required Arguments

  • sdk - The SDK to set.
Link to this function

with_source_subpath(module_source, path)

View Source
@spec with_source_subpath(t(), Dagger.String.t()) :: t()

Update the module source with a new source subpath.

required-arguments

Required Arguments

  • path - The path to set as the source subpath.