workspace
A generated module for Workspace functions
Installation
dagger install github.com/kpenfound/greetings-api/.dagger/workspace@1369898c3d21aceccef5afd5c26b1269abc0adef
Entrypoint
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@1369898c3d21aceccef5afd5c26b1269abc0adef call \
--source DIR_PATH
func (m *myModule) example(source *Directory, checker ) *Workspace {
return dag.
Workspace(source, checker)
}
@function
def example(source: dagger.Directory, checker: ) -> dag.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@1369898c3d21aceccef5afd5c26b1269abc0adef call \
--source DIR_PATH work
func (m *myModule) example(source *Directory, checker ) *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@1369898c3d21aceccef5afd5c26b1269abc0adef call \
--source DIR_PATH read --path string
func (m *myModule) example(ctx context.Context, source *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@1369898c3d21aceccef5afd5c26b1269abc0adef call \
--source DIR_PATH write --path string --contents string
func (m *myModule) example(source *Directory, checker , path string, contents string) *Workspace {
return dag.
Workspace(source, checker).
Write(path, contents)
}
@function
def example(source: dagger.Directory, checker: , path: str, contents: str) -> dag.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@1369898c3d21aceccef5afd5c26b1269abc0adef call \
--source DIR_PATH reset
func (m *myModule) example(source *Directory, checker ) *Workspace {
return dag.
Workspace(source, checker).
Reset()
}
@function
def example(source: dagger.Directory, checker: ) -> dag.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@1369898c3d21aceccef5afd5c26b1269abc0adef call \
--source DIR_PATH tree
func (m *myModule) example(ctx context.Context, source *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@1369898c3d21aceccef5afd5c26b1269abc0adef call \
--source DIR_PATH check
func (m *myModule) example(ctx context.Context, source *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@1369898c3d21aceccef5afd5c26b1269abc0adef call \
--source DIR_PATH diff
func (m *myModule) example(ctx context.Context, source *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()
}