toy-workspace
A toy workspace for editing and building go programs
Installation
dagger install github.com/shykes/melvin/toy-workspace@efce73bff57b24f54fcdfc387fb987dd99146f05
Entrypoint
Return Type
ToyWorkspace !
Example
dagger -m github.com/shykes/melvin/toy-workspace@efce73bff57b24f54fcdfc387fb987dd99146f05 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@efce73bff57b24f54fcdfc387fb987dd99146f05 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
Name | Type | Default Value | Description |
---|---|---|---|
path | String ! | - | The path of the file |
Example
dagger -m github.com/shykes/melvin/toy-workspace@efce73bff57b24f54fcdfc387fb987dd99146f05 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
Name | Type | Default Value | Description |
---|---|---|---|
path | String ! | - | The path of the file |
content | String ! | - | The content to write |
Example
dagger -m github.com/shykes/melvin/toy-workspace@efce73bff57b24f54fcdfc387fb987dd99146f05 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@efce73bff57b24f54fcdfc387fb987dd99146f05 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()
}