Dagger
Search

mod

The functions are used inside the hands-on lab: https://dagger-techlab.puzzle.ch/

Installation

dagger install github.com/puzzle/dagger-techlab/mod@e6aad328bf32f1c31154625792a90e061ccbd295

Entrypoint

Return Type
Mod
Example
dagger -m github.com/puzzle/dagger-techlab/mod@e6aad328bf32f1c31154625792a90e061ccbd295 call \
func (m *myModule) example() *Mod  {
	return dag.
			Mod()
}
@function
def example() -> dag.Mod:
	return (
		dag.mod()
	)
@func()
example(): Mod {
	return dag
		.mod()
}

Types

Mod 🔗

hello() 🔗

Say hello to the world! Code taken from https://github.com/shykes/hello. Thanks!

Return Type
String !
Arguments
NameTypeDefault ValueDescription
greetingString "hello"Change the greeting
nameString "world"Change the name
giantBoolean -Encode the message in giant multi-character letters
shoutBoolean -Make the message uppercase, and add more exclamation points
figletContainerContainer -Custom container for running the figlet tool
Example
dagger -m github.com/puzzle/dagger-techlab/mod@e6aad328bf32f1c31154625792a90e061ccbd295 call \
 hello
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Mod().
			Hello(ctx)
}
@function
async def example() -> str:
	return await (
		dag.mod()
		.hello()
	)
@func()
async example(): Promise<string> {
	return dag
		.mod()
		.hello()
}

ls() 🔗

Returns the files of the directory

Return Type
String !
Arguments
NameTypeDefault ValueDescription
dirDirectory !-directory to list it's files
Example
dagger -m github.com/puzzle/dagger-techlab/mod@e6aad328bf32f1c31154625792a90e061ccbd295 call \
 ls --dir DIR_PATH
func (m *myModule) example(ctx context.Context, dir *Directory) string  {
	return dag.
			Mod().
			Ls(ctx, dir)
}
@function
async def example(dir: dagger.Directory) -> str:
	return await (
		dag.mod()
		.ls(dir)
	)
@func()
async example(dir: Directory): Promise<string> {
	return dag
		.mod()
		.ls(dir)
}

os() 🔗

Returns the operating system of the container

Return Type
String !
Arguments
NameTypeDefault ValueDescription
ctrContainer !-container to get is's OS
Example
dagger -m github.com/puzzle/dagger-techlab/mod@e6aad328bf32f1c31154625792a90e061ccbd295 call \
 os --ctr IMAGE:TAG
func (m *myModule) example(ctx context.Context, ctr *Container) string  {
	return dag.
			Mod().
			Os(ctx, ctr)
}
@function
async def example(ctr: dagger.Container) -> str:
	return await (
		dag.mod()
		.os(ctr)
	)
@func()
async example(ctr: Container): Promise<string> {
	return dag
		.mod()
		.os(ctr)
}

unlock() 🔗

Returns the answer to everything when the password is right.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
passwordSecret !-container to get is's OS
Example
dagger -m github.com/puzzle/dagger-techlab/mod@e6aad328bf32f1c31154625792a90e061ccbd295 call \
 unlock --password env:MYSECRET
func (m *myModule) example(ctx context.Context, password *Secret) string  {
	return dag.
			Mod().
			Unlock(ctx, password)
}
@function
async def example(password: dagger.Secret) -> str:
	return await (
		dag.mod()
		.unlock(password)
	)
@func()
async example(password: Secret): Promise<string> {
	return dag
		.mod()
		.unlock(password)
}