test
This module has been generated via dagger init and serves as a reference to basic module structure as you get started with Dagger.Two functions have been pre-created. You can modify, delete, or add to them, as needed. They demonstrate usage of arguments and return types using simple echo and grep commands. The functions can be called from the dagger CLI or from one of the SDKs.
The first line in this comment block is a short description line and the rest is a long description with more detail on the module's purpose or usage, if appropriate. All modules should have a short description.
Installation
dagger install github.com/dagger/dagger-test-modules/py@2cb6cb4b0dba52c1e65b3ff46dd1a4a8f9a02f94
Entrypoint
Return Type
Test !
Example
dagger -m github.com/dagger/dagger-test-modules/py@2cb6cb4b0dba52c1e65b3ff46dd1a4a8f9a02f94 call \
func (m *myModule) example() *Test {
return dag.
Test()
}
@function
def example() -> dag.Test:
return (
dag.test()
)
@func()
example(): Test {
return dag
.test()
}
Types
Test 🔗
containerEcho() 🔗
Returns a container that echoes whatever string argument is provided
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
stringArg | String ! | - | No description provided |
Example
dagger -m github.com/dagger/dagger-test-modules/py@2cb6cb4b0dba52c1e65b3ff46dd1a4a8f9a02f94 call \
container-echo --string-arg string
func (m *myModule) example(stringArg string) *Container {
return dag.
Test().
ContainerEcho(stringArg)
}
@function
def example(string_arg: str) -> dagger.Container:
return (
dag.test()
.container_echo(string_arg)
)
@func()
example(stringArg: string): Container {
return dag
.test()
.containerEcho(stringArg)
}
grepDir() 🔗
Returns lines that match a pattern in the files of the provided Directory
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
directoryArg | Directory ! | - | A directory. |
pattern | String ! | - | No description provided |
Example
dagger -m github.com/dagger/dagger-test-modules/py@2cb6cb4b0dba52c1e65b3ff46dd1a4a8f9a02f94 call \
grep-dir --directory-arg DIR_PATH --pattern string
func (m *myModule) example(ctx context.Context, directoryArg *Directory, pattern string) string {
return dag.
Test().
GrepDir(ctx, directoryArg, pattern)
}
@function
async def example(directory_arg: dagger.Directory, pattern: str) -> str:
return await (
dag.test()
.grep_dir(directory_arg, pattern)
)
@func()
async example(directoryArg: Directory, pattern: string): Promise<string> {
return dag
.test()
.grepDir(directoryArg, pattern)
}