hello
This module serves as a learning template showing how to return strings,chain containers, generate files, and use default or optional arguments.
Installation
dagger install github.com/softwaredevelop/daggerverse/hello@161a87b2160811ed148007ec0b7cbfe7b0cb7844Entrypoint
Return Type
Hello !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| image | String | - | Custom image reference in "repository:tag" format. |
| greeting | String | "Hello" | Default greeting word to use (e.g. "Hello", "Hola", "Szia"). |
Example
dagger -m github.com/softwaredevelop/daggerverse/hello@161a87b2160811ed148007ec0b7cbfe7b0cb7844 call \
func (m *MyModule) Example() *dagger.Hello {
return dag.
Hello()
}@function
def example() -> dagger.Hello:
return (
dag.hello()
)@func()
example(): Hello {
return dag
.hello()
}Types
Hello 🔗
Hello provides greeting and demonstration functions.
message() 🔗
Message returns a greeting string using pure Go (runs instantly without containers).
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String | "Daggerverse" | Name of the person or entity to greet. |
Example
dagger -m github.com/softwaredevelop/daggerverse/hello@161a87b2160811ed148007ec0b7cbfe7b0cb7844 call \
messagefunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Hello().
Message(ctx)
}@function
async def example() -> str:
return await (
dag.hello()
.message()
)@func()
async example(): Promise<string> {
return dag
.hello()
.message()
}say() 🔗
Say executes an echo command inside the container and returns stdout.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String | "Daggerverse" | Name to greet inside the container. |
Example
dagger -m github.com/softwaredevelop/daggerverse/hello@161a87b2160811ed148007ec0b7cbfe7b0cb7844 call \
sayfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Hello().
Say(ctx)
}@function
async def example() -> str:
return await (
dag.hello()
.say()
)@func()
async example(): Promise<string> {
return dag
.hello()
.say()
}terminal() 🔗
Terminal returns the container prepared with the message, ready for chaining or interactive shell.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| message | String | "Welcome to Dagger!" | Message to echo when container starts. |
Example
dagger -m github.com/softwaredevelop/daggerverse/hello@161a87b2160811ed148007ec0b7cbfe7b0cb7844 call \
terminalfunc (m *MyModule) Example() *dagger.Container {
return dag.
Hello().
Terminal()
}@function
def example() -> dagger.Container:
return (
dag.hello()
.terminal()
)@func()
example(): Container {
return dag
.hello()
.terminal()
}write() 🔗
Write generates a greeting text file inside Dagger and returns it as an artifact.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String | "Daggerverse" | Name to greet in the generated file. |
Example
dagger -m github.com/softwaredevelop/daggerverse/hello@161a87b2160811ed148007ec0b7cbfe7b0cb7844 call \
writefunc (m *MyModule) Example() *dagger.File {
return dag.
Hello().
Write()
}@function
def example() -> dagger.File:
return (
dag.hello()
.write()
)@func()
example(): File {
return dag
.hello()
.write()
}