class ModuleSource extends AbstractObject implements IdAble

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

Properties

$lastQuery from  AbstractObject

Methods

__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

null|array|string|int|float|bool
queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

asModule()

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

string
asString()

A human readable ref string representation of this module source.

string
cloneRef()

The ref to clone the root of the git repo from. Only valid for git sources.

string
commit()

The resolved commit of the git repo this source points to. Only valid for git sources.

bool
configExists()

Whether an existing dagger.json for the module was found.

contextDirectory()

The full directory loaded for the module source, including the source code as a subdirectory.

array
dependencies()

The dependencies of the module source.

string
digest()

A content-hash of the module source. Module sources with the same digest will output the same generated context and convert into the same module instance.

directory(string $path)

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

string
engineVersion()

The engine version of the module.

generatedContextDirectory()

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

string
htmlRepoURL()

The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket). Only valid for git sources.

string
htmlURL()

The URL to the source's git repo in a web browser. Only valid for git sources.

id()

A unique identifier for this ModuleSource.

ModuleSourceKind
kind()

The kind of module source (currently local, git or dir).

string
localContextDirectoryPath()

The full absolute path to the context directory on the caller's host filesystem that this module source is loaded from. Only valid for local module sources.

string
moduleName()

The name of the module, including any setting via the withName API.

string
moduleOriginalName()

The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).

string
pin()

The pinned version of this module source.

string
repoRootPath()

The import path corresponding to the root of the git repo this source points to. Only valid for git sources.

sdk()

The SDK configuration of the module.

string
sourceRootSubpath()

The path, relative to the context directory, that contains the module's dagger.json.

string
sourceSubpath()

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

sync()

Forces evaluation of the module source, including any loading into the engine and associated validation.

string
version()

The specified version of the git repo this source points to. Only valid for git sources.

withDependencies(array $dependencies)

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

withEngineVersion(string $version)

Upgrade the engine version of the module to the given value.

withIncludes(array $patterns)

Update the module source with additional include patterns for files+directories from its context that are required for building it

withName(string $name)

Update the module source with a new name.

withSDK(string $source)

Update the module source with a new SDK.

withSourceSubpath(string $path)

Update the module source with a new source subpath.

withUpdateDependencies(array $dependencies)

Update one or more module dependencies.

withoutDependencies(array $dependencies)

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

Details

in AbstractObject at line 13
__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

Parameters

AbstractClient $client
QueryBuilderChain $queryBuilderChain

in AbstractObject at line 19
protected null|array|string|int|float|bool queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

Parameters

QueryBuilder $leafQueryBuilder
string $leafKey

Return Value

null|array|string|int|float|bool

at line 19
Module asModule()

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

Return Value

Module

at line 28
string asString()

A human readable ref string representation of this module source.

Return Value

string

at line 37
string cloneRef()

The ref to clone the root of the git repo from. Only valid for git sources.

Return Value

string

at line 46
string commit()

The resolved commit of the git repo this source points to. Only valid for git sources.

Return Value

string

at line 55
bool configExists()

Whether an existing dagger.json for the module was found.

Return Value

bool

at line 64
Directory contextDirectory()

The full directory loaded for the module source, including the source code as a subdirectory.

Return Value

Directory

at line 73
array dependencies()

The dependencies of the module source.

Return Value

array

at line 82
string digest()

A content-hash of the module source. Module sources with the same digest will output the same generated context and convert into the same module instance.

Return Value

string

at line 91
Directory directory(string $path)

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

Parameters

string $path

Return Value

Directory

at line 101
string engineVersion()

The engine version of the module.

Return Value

string

at line 110
Directory generatedContextDirectory()

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

Return Value

Directory

at line 119
string htmlRepoURL()

The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket). Only valid for git sources.

Return Value

string

at line 128
string htmlURL()

The URL to the source's git repo in a web browser. Only valid for git sources.

Return Value

string

at line 137
AbstractId id()

A unique identifier for this ModuleSource.

Return Value

AbstractId

at line 146
ModuleSourceKind kind()

The kind of module source (currently local, git or dir).

Return Value

ModuleSourceKind

at line 155
string localContextDirectoryPath()

The full absolute path to the context directory on the caller's host filesystem that this module source is loaded from. Only valid for local module sources.

Return Value

string

at line 164
string moduleName()

The name of the module, including any setting via the withName API.

Return Value

string

at line 173
string moduleOriginalName()

The original name of the module as read from the module's dagger.json (or set for the first time with the withName API).

Return Value

string

at line 182
string pin()

The pinned version of this module source.

Return Value

string

at line 191
string repoRootPath()

The import path corresponding to the root of the git repo this source points to. Only valid for git sources.

Return Value

string

at line 200
SDKConfig sdk()

The SDK configuration of the module.

Return Value

SDKConfig

at line 209
string sourceRootSubpath()

The path, relative to the context directory, that contains the module's dagger.json.

Return Value

string

at line 218
string sourceSubpath()

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

Return Value

string

at line 227
ModuleSourceId sync()

Forces evaluation of the module source, including any loading into the engine and associated validation.

Return Value

ModuleSourceId

at line 236
string version()

The specified version of the git repo this source points to. Only valid for git sources.

Return Value

string

at line 245
ModuleSource withDependencies(array $dependencies)

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

Parameters

array $dependencies

Return Value

ModuleSource

at line 255
ModuleSource withEngineVersion(string $version)

Upgrade the engine version of the module to the given value.

Parameters

string $version

Return Value

ModuleSource

at line 265
ModuleSource withIncludes(array $patterns)

Update the module source with additional include patterns for files+directories from its context that are required for building it

Parameters

array $patterns

Return Value

ModuleSource

at line 275
ModuleSource withName(string $name)

Update the module source with a new name.

Parameters

string $name

Return Value

ModuleSource

at line 285
ModuleSource withSDK(string $source)

Update the module source with a new SDK.

Parameters

string $source

Return Value

ModuleSource

at line 295
ModuleSource withSourceSubpath(string $path)

Update the module source with a new source subpath.

Parameters

string $path

Return Value

ModuleSource

at line 305
ModuleSource withUpdateDependencies(array $dependencies)

Update one or more module dependencies.

Parameters

array $dependencies

Return Value

ModuleSource

at line 315
ModuleSource withoutDependencies(array $dependencies)

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

Parameters

array $dependencies

Return Value

ModuleSource