workspace
A workspace for developing Go code
Installation
dagger install github.com/kpenfound/kubesimplify-agent/workspace@66c0cb93615b6fc33c43df2d502da9665e24b417
Entrypoint
Return Type
Workspace !
Example
dagger -m github.com/kpenfound/kubesimplify-agent/workspace@66c0cb93615b6fc33c43df2d502da9665e24b417 call \
func (m *myModule) example() *dagger.Workspace {
return dag.
Workspace()
}
@function
def example() -> dagger.Workspace:
return (
dag.workspace()
)
@func()
example(): Workspace {
return dag
.workspace()
}
Types
Workspace 🔗
container() 🔗
Return Type
Container !
Example
dagger -m github.com/kpenfound/kubesimplify-agent/workspace@66c0cb93615b6fc33c43df2d502da9665e24b417 call \
container
func (m *myModule) example() *dagger.Container {
return dag.
Workspace().
Container()
}
@function
def example() -> dagger.Container:
return (
dag.workspace()
.container()
)
@func()
example(): Container {
return dag
.workspace()
.container()
}
read() 🔗
Read a file
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
path | String ! | - | No description provided |
Example
dagger -m github.com/kpenfound/kubesimplify-agent/workspace@66c0cb93615b6fc33c43df2d502da9665e24b417 call \
read --path string
func (m *myModule) example(ctx context.Context, path string) string {
return dag.
Workspace().
Read(ctx, path)
}
@function
async def example(path: str) -> str:
return await (
dag.workspace()
.read(path)
)
@func()
async example(path: string): Promise<string> {
return dag
.workspace()
.read(path)
}
write() 🔗
Write a file
Return Type
Workspace !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
path | String ! | - | No description provided |
contents | String ! | - | No description provided |
Example
dagger -m github.com/kpenfound/kubesimplify-agent/workspace@66c0cb93615b6fc33c43df2d502da9665e24b417 call \
write --path string --contents string
func (m *myModule) example(path string, contents string) *dagger.Workspace {
return dag.
Workspace().
Write(path, contents)
}
@function
def example(path: str, contents: str) -> dagger.Workspace:
return (
dag.workspace()
.write(path, contents)
)
@func()
example(path: string, contents: string): Workspace {
return dag
.workspace()
.write(path, contents)
}
build() 🔗
Build the code
Return Type
Void !
Example
dagger -m github.com/kpenfound/kubesimplify-agent/workspace@66c0cb93615b6fc33c43df2d502da9665e24b417 call \
build
func (m *myModule) example(ctx context.Context) {
return dag.
Workspace().
Build(ctx)
}
@function
async def example() -> None:
return await (
dag.workspace()
.build()
)
@func()
async example(): Promise<void> {
return dag
.workspace()
.build()
}