toy-workspace
No long description provided.
Installation
dagger install github.com/dagger/agents/toy-programmer/toy-workspace@cbe7598214d0d111ce3968e3937c3abdfc196c26Entrypoint
Return Type
ToyWorkspace ! Example
dagger -m github.com/dagger/agents/toy-programmer/toy-workspace@cbe7598214d0d111ce3968e3937c3abdfc196c26 call \
func (m *MyModule) Example() *dagger.ToyWorkspace {
return dag.
ToyWorkspace()
}@function
def example() -> dagger.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@cbe7598214d0d111ce3968e3937c3abdfc196c26 call \
containerfunc (m *MyModule) Example() *dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | - | No description provided |
Example
dagger -m github.com/dagger/agents/toy-programmer/toy-workspace@cbe7598214d0d111ce3968e3937c3abdfc196c26 call \
read --path stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | - | No description provided |
| content | String ! | - | No description provided |
Example
dagger -m github.com/dagger/agents/toy-programmer/toy-workspace@cbe7598214d0d111ce3968e3937c3abdfc196c26 call \
write --path string --content stringfunc (m *MyModule) Example(path string, content string) *dagger.ToyWorkspace {
return dag.
ToyWorkspace().
Write(path, content)
}@function
def example(path: str, content: str) -> dagger.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@cbe7598214d0d111ce3968e3937c3abdfc196c26 call \
buildfunc (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()
}