workspace
No long description provided.
Installation
dagger install github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133Entrypoint
Return Type
Workspace !Arguments
| Name | Type | Default Value | Description | 
|---|---|---|---|
| checker | Container | - | A builder container, for verifying that the code builds, tests run etc. Container spec: - Workspace will be mounted to container workdir - Container default args will be executed. - Exit code 0 is considered a successful check. Otherwise a failure. | 
| start | Directory | - | Initial state to start the workspace from By default the workspace starts empty | 
Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 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 🔗
A workspace for editing files and checking the result
dir() 🔗
An immutable snapshot of the workspace contents
Return Type
Directory !Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 dirfunc (m *MyModule) Example() *dagger.Directory  {
	return dag.
			Workspace().
			Dir()
}@function
def example() -> dagger.Directory:
	return (
		dag.workspace()
		.dir()
	)@func()
example(): Directory {
	return dag
		.workspace()
		.dir()
}check() 🔗
Check that the current contents is valid This is done by executed an externally-provided checker container with the workspace mounted. If there is no checker, the check will always pass
Return Type
String !Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 checkfunc (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Workspace().
			Check(ctx)
}@function
async def example() -> str:
	return await (
		dag.workspace()
		.check()
	)@func()
async example(): Promise<string> {
	return dag
		.workspace()
		.check()
}diff() 🔗
Return all changes to the workspace since the start of the session, in unified diff format, with the following convention: - before/ is the start state - after/ is the current state
Return Type
String !Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 difffunc (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Workspace().
			Diff(ctx)
}@function
async def example() -> str:
	return await (
		dag.workspace()
		.diff()
	)@func()
async example(): Promise<string> {
	return dag
		.workspace()
		.diff()
}checkpoint() 🔗
Checkpoint the current state of the workspace, with a description of the changes made.
Return Type
Workspace !Arguments
| Name | Type | Default Value | Description | 
|---|---|---|---|
| description | String ! | - | No description provided | 
Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 checkpoint --description stringfunc (m *MyModule) Example(description string) *dagger.Workspace  {
	return dag.
			Workspace().
			Checkpoint(description)
}@function
def example(description: str) -> dagger.Workspace:
	return (
		dag.workspace()
		.checkpoint(description)
	)@func()
example(description: string): Workspace {
	return dag
		.workspace()
		.checkpoint(description)
}history() 🔗
Return a history of all checkpoints so far, from first to last
Return Type
[String ! ] !Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 historyfunc (m *MyModule) Example(ctx context.Context) []string  {
	return dag.
			Workspace().
			History(ctx)
}@function
async def example() -> List[str]:
	return await (
		dag.workspace()
		.history()
	)@func()
async example(): Promise<string[]> {
	return dag
		.workspace()
		.history()
}reset() 🔗
Reset the workspace to its starting state. Warning: this will wipe all changes made during the current session
Return Type
Workspace !Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 resetfunc (m *MyModule) Example() *dagger.Workspace  {
	return dag.
			Workspace().
			Reset()
}@function
def example() -> dagger.Workspace:
	return (
		dag.workspace()
		.reset()
	)@func()
example(): Workspace {
	return dag
		.workspace()
		.reset()
}write() 🔗
Write to a file in the workspace
Return Type
Workspace !Arguments
| Name | Type | Default Value | Description | 
|---|---|---|---|
| path | String ! | - | The path of the file to write | 
| contents | String ! | - | The contents to write | 
Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 write --path string --contents stringfunc (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)
}copyDir() 🔗
Copy an entire directory into the workspace
Return Type
Workspace !Arguments
| Name | Type | Default Value | Description | 
|---|---|---|---|
| path | String ! | - | The target path | 
| dir | Directory ! | - | The directory to copy at the target path. Existing content is overwritten at the file granularity. | 
Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 copy-dir --path string --dir DIR_PATHfunc (m *MyModule) Example(path string, dir *dagger.Directory) *dagger.Workspace  {
	return dag.
			Workspace().
			CopyDir(path, dir)
}@function
def example(path: str, dir: dagger.Directory) -> dagger.Workspace:
	return (
		dag.workspace()
		.copy_dir(path, dir)
	)@func()
example(path: string, dir: Directory): Workspace {
	return dag
		.workspace()
		.copyDir(path, dir)
}read() 🔗
Read the contents of a file in thw workspace
Return Type
String !Arguments
| Name | Type | Default Value | Description | 
|---|---|---|---|
| path | String ! | - | No description provided | 
Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 read --path stringfunc (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)
}rm() 🔗
Remove a file from the workspace
Return Type
Workspace !Arguments
| Name | Type | Default Value | Description | 
|---|---|---|---|
| path | String ! | - | No description provided | 
Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 rm --path stringfunc (m *MyModule) Example(path string) *dagger.Workspace  {
	return dag.
			Workspace().
			Rm(path)
}@function
def example(path: str) -> dagger.Workspace:
	return (
		dag.workspace()
		.rm(path)
	)@func()
example(path: string): Workspace {
	return dag
		.workspace()
		.rm(path)
}rmDir() 🔗
Remove a directory from the workspace
Return Type
Workspace !Arguments
| Name | Type | Default Value | Description | 
|---|---|---|---|
| path | String ! | - | No description provided | 
Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 rm-dir --path stringfunc (m *MyModule) Example(path string) *dagger.Workspace  {
	return dag.
			Workspace().
			RmDir(path)
}@function
def example(path: str) -> dagger.Workspace:
	return (
		dag.workspace()
		.rm_dir(path)
	)@func()
example(path: string): Workspace {
	return dag
		.workspace()
		.rmDir(path)
}listDir() 🔗
List the contents of a directory in the workspace
Return Type
[String ! ] !Arguments
| Name | Type | Default Value | Description | 
|---|---|---|---|
| path | String | "/" | Path of the target directory | 
Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 list-dirfunc (m *MyModule) Example(ctx context.Context) []string  {
	return dag.
			Workspace().
			ListDir(ctx)
}@function
async def example() -> List[str]:
	return await (
		dag.workspace()
		.list_dir()
	)@func()
async example(): Promise<string[]> {
	return dag
		.workspace()
		.listDir()
}walk() 🔗
Walk all files in the workspace (optionally filtered by a glob pattern), and return their path.
Return Type
[String ! ] !Arguments
| Name | Type | Default Value | Description | 
|---|---|---|---|
| pattern | String | "**" | A glob pattern to filter files. Only matching files will be included. The glob format is the same as Dockerfile/buildkit | 
Example
dagger -m github.com/lgtdio/melvin/workspace@d5b477feb1036e6f1ec6f4cbb9d4a6cde0511133 call \
 walkfunc (m *MyModule) Example(ctx context.Context) []string  {
	return dag.
			Workspace().
			Walk(ctx)
}@function
async def example() -> List[str]:
	return await (
		dag.workspace()
		.walk()
	)@func()
async example(): Promise<string[]> {
	return dag
		.workspace()
		.walk()
}