View Source Dagger.ModuleSource (dagger v0.15.2)

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 and use the module.

The effective module source dependencies from the configuration, and calls to withDependencies and withoutDependencies.

Return the module source's content digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.

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 pinned version of this module source.

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 one or more module dependencies.

Update the module source with a new named view.

Remove the provided dependencies from the module source's dependency list.

Types

t()

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

Functions

as_git_source(module_source)

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

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

as_local_source(module_source)

@spec as_local_source(t()) :: Dagger.LocalModuleSource.t() | nil

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

as_module(module_source, optional_args \\ [])

@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

as_string(module_source)

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

A human readable ref string representation of this module source.

config_exists(module_source)

@spec config_exists(t()) :: {:ok, boolean()} | {:error, term()}

Returns whether the module source has a configuration file.

context_directory(module_source)

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

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

dependencies(module_source)

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

The effective module source dependencies from the configuration, and calls to withDependencies and withoutDependencies.

digest(module_source)

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

Return the module source's content digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.

directory(module_source, path)

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

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

id(module_source)

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

A unique identifier for this ModuleSource.

kind(module_source)

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

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

module_name(module_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.

module_original_name(module_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.

pin(module_source)

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

The pinned version of this module source.

resolve_context_path_from_caller(module_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.

resolve_dependency(module_source, dep)

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

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

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

@spec resolve_directory_from_caller(t(), String.t(),
  view_name: String.t() | nil,
  ignore: [String.t()]
) ::
  Dagger.Directory.t()

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

resolve_from_caller(module_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.

source_root_subpath(module_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.

source_subpath(module_source)

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

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

view(module_source, name)

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

Retrieve a named view defined for this module source.

views(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.

with_context_directory(module_source, dir)

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

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

with_dependencies(module_source, dependencies)

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

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

with_init(module_source, optional_args \\ [])

@spec with_init(t(), [{:merge, boolean() | nil}]) :: t()

Sets module init arguments

with_name(module_source, name)

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

Update the module source with a new name.

with_sdk(module_source, sdk)

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

Update the module source with a new SDK.

with_source_subpath(module_source, path)

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

Update the module source with a new source subpath.

with_update_dependencies(module_source, dependencies)

@spec with_update_dependencies(t(), [String.t()]) :: t()

Update one or more module dependencies.

with_view(module_source, name, patterns)

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

Update the module source with a new named view.

without_dependencies(module_source, dependencies)

@spec without_dependencies(t(), [String.t()]) :: t()

Remove the provided dependencies from the module source's dependency list.