View Source Dagger.ModuleSource (dagger v0.9.9)
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
Link to this section Functions
@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.
@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.
@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
@spec as_string(t()) :: {:ok, Dagger.String.t()} | {:error, term()}
A human readable ref string representation of this module source.
@spec config_exists(t()) :: {:ok, Dagger.Boolean.t()} | {:error, term()}
Returns whether the module source has a configuration file.
@spec context_directory(t()) :: Dagger.Directory.t()
The directory containing everything needed to load load and use the module.
@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.
@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.)
@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.
@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.
@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.
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.
Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources.
@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.
@spec source_subpath(t()) :: {:ok, Dagger.String.t()} | {:error, term()}
The path relative to context of the module implementation source code.
@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.
@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.
@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.
@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.
@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.