Dagger
Search

toy-workspace

A toy workspace for editing and building go programs

Installation

dagger install github.com/shykes/melvin/toy-workspace@3ef5fa45c0eeaa07d8534ad061cf5c4377d07392

Entrypoint

Return Type
ToyWorkspace !
Example
dagger -m github.com/shykes/melvin/toy-workspace@3ef5fa45c0eeaa07d8534ad061cf5c4377d07392 call \
func (m *myModule) example() *ToyWorkspace  {
	return dag.
			ToyWorkspace()
}
@function
def example() -> dag.ToyWorkspace:
	return (
		dag.toy_workspace()
	)
@func()
example(): ToyWorkspace {
	return dag
		.toyWorkspace()
}

Types

ToyWorkspace 🔗

container() 🔗

The workspace container.

Return Type
Container !
Example
dagger -m github.com/shykes/melvin/toy-workspace@3ef5fa45c0eeaa07d8534ad061cf5c4377d07392 call \
 container
func (m *myModule) example() *Container  {
	return dag.
			ToyWorkspace().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.toy_workspace()
		.container()
	)
@func()
example(): Container {
	return dag
		.toyWorkspace()
		.container()
}

read() 🔗

Read a file

Return Type
String !
Arguments
NameTypeDefault ValueDescription
pathString !-The path of the file
Example
dagger -m github.com/shykes/melvin/toy-workspace@3ef5fa45c0eeaa07d8534ad061cf5c4377d07392 call \
 read --path string
func (m *myModule) example(ctx context.Context, path string) string  {
	return dag.
			ToyWorkspace().
			Read(ctx, path)
}
@function
async def example(path: str) -> str:
	return await (
		dag.toy_workspace()
		.read(path)
	)
@func()
async example(path: string): Promise<string> {
	return dag
		.toyWorkspace()
		.read(path)
}

write() 🔗

Write a file

Return Type
ToyWorkspace !
Arguments
NameTypeDefault ValueDescription
pathString !-The path of the file
contentString !-The content to write
Example
dagger -m github.com/shykes/melvin/toy-workspace@3ef5fa45c0eeaa07d8534ad061cf5c4377d07392 call \
 write --path string --content string
func (m *myModule) example(path string, content string) *ToyWorkspace  {
	return dag.
			ToyWorkspace().
			Write(path, content)
}
@function
def example(path: str, content: str) -> dag.ToyWorkspace:
	return (
		dag.toy_workspace()
		.write(path, content)
	)
@func()
example(path: string, content: string): ToyWorkspace {
	return dag
		.toyWorkspace()
		.write(path, content)
}

build() 🔗

Build the code at the current directory in the workspace

Return Type
String !
Example
dagger -m github.com/shykes/melvin/toy-workspace@3ef5fa45c0eeaa07d8534ad061cf5c4377d07392 call \
 build
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			ToyWorkspace().
			Build(ctx)
}
@function
async def example() -> str:
	return await (
		dag.toy_workspace()
		.build()
	)
@func()
async example(): Promise<string> {
	return dag
		.toyWorkspace()
		.build()
}