workspace
A generated module for Workspace functions
Installation
dagger install github.com/kpenfound/greetings-api/.dagger/workspace@404f0d12c0acd2dc3331505f6efd3a460b630492Entrypoint
Return Type
Workspace !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Initial state of the workspace |
| checker | Interface ! | - | Checker to use for testing |
Example
dagger -m github.com/kpenfound/greetings-api/.dagger/workspace@404f0d12c0acd2dc3331505f6efd3a460b630492 call \
--source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory, checker ) *dagger.Workspace {
return dag.
Workspace(source, checker)
}@function
def example(source: dagger.Directory, checker: ) -> dagger.Workspace:
return (
dag.workspace(source, checker)
)@func()
example(source: Directory, checker: ): Workspace {
return dag
.workspace(source, checker)
}Types
Workspace 🔗
Place to do work and check it
work() 🔗
Return Type
Directory ! Example
dagger -m github.com/kpenfound/greetings-api/.dagger/workspace@404f0d12c0acd2dc3331505f6efd3a460b630492 call \
--source DIR_PATH workfunc (m *MyModule) Example(source *dagger.Directory, checker ) *dagger.Directory {
return dag.
Workspace(source, checker).
Work()
}@function
def example(source: dagger.Directory, checker: ) -> dagger.Directory:
return (
dag.workspace(source, checker)
.work()
)@func()
example(source: Directory, checker: ): Directory {
return dag
.workspace(source, checker)
.work()
}read() 🔗
Read the contents of a file in the workspace at the given path
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | - | Path to read the file at |
Example
dagger -m github.com/kpenfound/greetings-api/.dagger/workspace@404f0d12c0acd2dc3331505f6efd3a460b630492 call \
--source DIR_PATH read --path stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, checker , path string) string {
return dag.
Workspace(source, checker).
Read(ctx, path)
}@function
async def example(source: dagger.Directory, checker: , path: str) -> str:
return await (
dag.workspace(source, checker)
.read(path)
)@func()
async example(source: Directory, checker: , path: string): Promise<string> {
return dag
.workspace(source, checker)
.read(path)
}write() 🔗
Write the contents of a file in the workspace at the given path
Return Type
Workspace !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | - | Path to write the file to |
| contents | String ! | - | Contents to write to the file |
Example
dagger -m github.com/kpenfound/greetings-api/.dagger/workspace@404f0d12c0acd2dc3331505f6efd3a460b630492 call \
--source DIR_PATH write --path string --contents stringfunc (m *MyModule) Example(source *dagger.Directory, checker , path string, contents string) *dagger.Workspace {
return dag.
Workspace(source, checker).
Write(path, contents)
}@function
def example(source: dagger.Directory, checker: , path: str, contents: str) -> dagger.Workspace:
return (
dag.workspace(source, checker)
.write(path, contents)
)@func()
example(source: Directory, checker: , path: string, contents: string): Workspace {
return dag
.workspace(source, checker)
.write(path, contents)
}reset() 🔗
Reset the workspace to the original state
Return Type
Workspace ! Example
dagger -m github.com/kpenfound/greetings-api/.dagger/workspace@404f0d12c0acd2dc3331505f6efd3a460b630492 call \
--source DIR_PATH resetfunc (m *MyModule) Example(source *dagger.Directory, checker ) *dagger.Workspace {
return dag.
Workspace(source, checker).
Reset()
}@function
def example(source: dagger.Directory, checker: ) -> dagger.Workspace:
return (
dag.workspace(source, checker)
.reset()
)@func()
example(source: Directory, checker: ): Workspace {
return dag
.workspace(source, checker)
.reset()
}tree() 🔗
List the files in the workspace in tree format
Return Type
String ! Example
dagger -m github.com/kpenfound/greetings-api/.dagger/workspace@404f0d12c0acd2dc3331505f6efd3a460b630492 call \
--source DIR_PATH treefunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, checker ) string {
return dag.
Workspace(source, checker).
Tree(ctx)
}@function
async def example(source: dagger.Directory, checker: ) -> str:
return await (
dag.workspace(source, checker)
.tree()
)@func()
async example(source: Directory, checker: ): Promise<string> {
return dag
.workspace(source, checker)
.tree()
}check() 🔗
Run the tests in the workspace
Return Type
String ! Example
dagger -m github.com/kpenfound/greetings-api/.dagger/workspace@404f0d12c0acd2dc3331505f6efd3a460b630492 call \
--source DIR_PATH checkfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, checker ) string {
return dag.
Workspace(source, checker).
Check(ctx)
}@function
async def example(source: dagger.Directory, checker: ) -> str:
return await (
dag.workspace(source, checker)
.check()
)@func()
async example(source: Directory, checker: ): Promise<string> {
return dag
.workspace(source, checker)
.check()
}diff() 🔗
Show the changes made to the workspace so far in unified diff format
Return Type
String ! Example
dagger -m github.com/kpenfound/greetings-api/.dagger/workspace@404f0d12c0acd2dc3331505f6efd3a460b630492 call \
--source DIR_PATH difffunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, checker ) string {
return dag.
Workspace(source, checker).
Diff(ctx)
}@function
async def example(source: dagger.Directory, checker: ) -> str:
return await (
dag.workspace(source, checker)
.diff()
)@func()
async example(source: Directory, checker: ): Promise<string> {
return dag
.workspace(source, checker)
.diff()
}