Dagger
Search

workspace

No long description provided.

Installation

dagger install github.com/johnhkchen/ezstack/.dagger/workspace@3683e105f98ddb37550fdfd8ca1eddad9caff7d2

Entrypoint

Return Type
Workspace !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/johnhkchen/ezstack/.dagger/workspace@3683e105f98ddb37550fdfd8ca1eddad9caff7d2 call \
 --source DIR_PATH
func (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
NameTypeDefault ValueDescription
pathString !-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 string
func (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
NameTypeDefault ValueDescription
pathString !-The path to the file in the workspace
contentsString !-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 string
func (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-files
func (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-source
func (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()
}