workspace
No long description provided.
Installation
dagger install github.com/johnhkchen/ezstack/.dagger/workspace@3683e105f98ddb37550fdfd8ca1eddad9caff7d2Entrypoint
Return Type
Workspace !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/johnhkchen/ezstack/.dagger/workspace@3683e105f98ddb37550fdfd8ca1eddad9caff7d2 call \
--source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Workspace {
return dag.
Workspace(source)
}@function
def example(source: dagger.Directory) -> dagger.Workspace:
return (
dag.workspace(source)
)@func()
example(source: Directory): Workspace {
return dag
.workspace(source)
}Types
Workspace 🔗
readFile() 🔗
Read a file in the Workspace
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | - | The path to the file in the workspace |
Example
dagger -m github.com/johnhkchen/ezstack/.dagger/workspace@3683e105f98ddb37550fdfd8ca1eddad9caff7d2 call \
--source DIR_PATH read-file --path stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, path string) string {
return dag.
Workspace(source).
ReadFile(ctx, path)
}@function
async def example(source: dagger.Directory, path: str) -> str:
return await (
dag.workspace(source)
.read_file(path)
)@func()
async example(source: Directory, path: string): Promise<string> {
return dag
.workspace(source)
.readFile(path)
}writeFile() 🔗
Write a file to the Workspace
Return Type
Workspace !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | - | The path to the file in the workspace |
| contents | String ! | - | The new contents of the file |
Example
dagger -m github.com/johnhkchen/ezstack/.dagger/workspace@3683e105f98ddb37550fdfd8ca1eddad9caff7d2 call \
--source DIR_PATH write-file --path string --contents stringfunc (m *MyModule) Example(source *dagger.Directory, path string, contents string) *dagger.Workspace {
return dag.
Workspace(source).
WriteFile(path, contents)
}@function
def example(source: dagger.Directory, path: str, contents: str) -> dagger.Workspace:
return (
dag.workspace(source)
.write_file(path, contents)
)@func()
example(source: Directory, path: string, contents: string): Workspace {
return dag
.workspace(source)
.writeFile(path, contents)
}listFiles() 🔗
List all of the files in the Workspace
Return Type
String ! Example
dagger -m github.com/johnhkchen/ezstack/.dagger/workspace@3683e105f98ddb37550fdfd8ca1eddad9caff7d2 call \
--source DIR_PATH list-filesfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory) string {
return dag.
Workspace(source).
ListFiles(ctx)
}@function
async def example(source: dagger.Directory) -> str:
return await (
dag.workspace(source)
.list_files()
)@func()
async example(source: Directory): Promise<string> {
return dag
.workspace(source)
.listFiles()
}getSource() 🔗
Get the source code directory from the Workspace
Return Type
Directory ! Example
dagger -m github.com/johnhkchen/ezstack/.dagger/workspace@3683e105f98ddb37550fdfd8ca1eddad9caff7d2 call \
--source DIR_PATH get-sourcefunc (m *MyModule) Example(source *dagger.Directory) *dagger.Directory {
return dag.
Workspace(source).
GetSource()
}@function
def example(source: dagger.Directory) -> dagger.Directory:
return (
dag.workspace(source)
.get_source()
)@func()
example(source: Directory): Directory {
return dag
.workspace(source)
.getSource()
}