Dagger
Search

toy-workspace

No long description provided.

Installation

dagger install github.com/dagger/agents/toy-programmer/toy-workspace@2b1b0b3eec2f32d070d1ab99535968a1c062eff7

Entrypoint

Return Type
ToyWorkspace !
Example
dagger -m github.com/dagger/agents/toy-programmer/toy-workspace@2b1b0b3eec2f32d070d1ab99535968a1c062eff7 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 🔗

A toy workspace that can edit files and run 'go build'

container() 🔗

The workspace’s container state.

Return Type
Container !
Example
dagger -m github.com/dagger/agents/toy-programmer/toy-workspace@2b1b0b3eec2f32d070d1ab99535968a1c062eff7 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 !-No description provided
Example
dagger -m github.com/dagger/agents/toy-programmer/toy-workspace@2b1b0b3eec2f32d070d1ab99535968a1c062eff7 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 !-No description provided
contentString !-No description provided
Example
dagger -m github.com/dagger/agents/toy-programmer/toy-workspace@2b1b0b3eec2f32d070d1ab99535968a1c062eff7 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
Void !
Example
dagger -m github.com/dagger/agents/toy-programmer/toy-workspace@2b1b0b3eec2f32d070d1ab99535968a1c062eff7 call \
 build
func (m *myModule) example(ctx context.Context)   {
	return dag.
			ToyWorkspace().
			Build(ctx)
}
@function
async def example() -> None:
	return await (
		dag.toy_workspace()
		.build()
	)
@func()
async example(): Promise<void> {
	return dag
		.toyWorkspace()
		.build()
}