View Source Dagger.ModuleSource (dagger v0.12.3)

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

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 a directory from the caller optionally with a given view applied.

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.

Retrieve a named view defined for this module source.

The named views defined for this module source, which are sets of directory filters that can be applied to directory arguments provided to functions.

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.

Update the module source with a new named view.

Types

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

Functions

Link to this function

as_git_source(module_source)

View Source
@spec as_git_source(t()) :: Dagger.GitModuleSource.t() | nil

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()) :: Dagger.LocalModuleSource.t() | nil

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

Link to this function

as_module(module_source, optional_args \\ [])

View Source
@spec as_module(t(), [{:engine_version, String.t() | nil}]) :: 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, 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, boolean()} | {: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(), String.t()) :: Dagger.Directory.t()

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

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

A unique identifier for this ModuleSource.

@spec kind(t()) :: Dagger.ModuleSourceKind.t()

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

Link to this function

module_name(module_source)

View Source
@spec module_name(t()) :: {:ok, 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, 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, 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.

Link to this function

resolve_directory_from_caller(module_source, path, optional_args \\ [])

View Source
@spec resolve_directory_from_caller(t(), String.t(), [{:view_name, String.t() | nil}]) ::
  Dagger.Directory.t()

Load a directory from the caller optionally with a given view applied.

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, 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, String.t()} | {:error, term()}

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

Link to this function

view(module_source, name)

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

Retrieve a named view defined for this module source.

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

The named views defined for this module source, which are sets of directory filters that can be applied to directory arguments provided to functions.

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.

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.

Link to this function

with_name(module_source, name)

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

Update the module source with a new name.

Link to this function

with_sdk(module_source, sdk)

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

Update the module source with a new SDK.

Link to this function

with_source_subpath(module_source, path)

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

Update the module source with a new source subpath.

Link to this function

with_view(module_source, name, patterns)

View Source
@spec with_view(t(), String.t(), [String.t()]) :: t()

Update the module source with a new named view.