dagger/dsl/directory

Types

pub type FilterFns {
  Filter
  WithDirectory
}

Constructors

  • Filter
  • WithDirectory
pub type ForDockerBuild
pub type ForEntries
pub type ForExists
pub type ForExport
pub type ForSearch
pub type ForTerminal
pub opaque type Opts(tag_)

Values

pub fn as_git(parent: types.Directory) -> types.GitRepository

Converts this directory to a local git repository

pub fn as_module(
  parent: types.Directory,
  with with_fn: fn(Opts(a)) -> Opts(a),
) -> types.Module

Load the directory as a Dagger module source

pub fn as_module_source(
  parent: types.Directory,
  with with_fn: fn(Opts(a)) -> Opts(a),
) -> types.ModuleSource

Load the directory as a Dagger module source

pub fn changes(
  parent: types.Directory,
  from from: types.Directory,
) -> types.Changeset

Return the difference between this directory and another directory, typically an older snapshot. The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.

pub fn chown(
  parent: types.Directory,
  path path: String,
  owner owner: String,
) -> types.Directory

Change the owner of the directory contents recursively.

pub fn diff(
  parent: types.Directory,
  other other: types.Directory,
) -> types.Directory

Return the difference between this directory and an another directory. The difference is encoded as a directory.

pub fn digest(
  parent: types.Directory,
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

Return the directory’s digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.

pub fn directory() -> types.Directory
pub fn docker_build(
  parent: types.Directory,
  with with_fn: fn(Opts(ForDockerBuild)) -> Opts(ForDockerBuild),
) -> types.Container

Use Dockerfile compatibility to build a container from this directory. Only use this function for Dockerfile compatibility. Otherwise use the native Container type directly, it is feature-complete and supports all Dockerfile features.

pub fn entries(
  parent: types.Directory,
  with with_fn: fn(Opts(ForEntries)) -> Opts(ForEntries),
  client client: types.Client,
  then handler: fn(Result(List(String), types.QueryError)) -> a,
) -> a

Returns a list of files and directories at the given path.

pub fn exists(
  parent: types.Directory,
  path path: String,
  with with_fn: fn(Opts(ForExists)) -> Opts(ForExists),
  client client: types.Client,
  then handler: fn(Result(Bool, types.QueryError)) -> a,
) -> a

check if a file or directory exists

pub fn export(
  parent: types.Directory,
  path path: String,
  with with_fn: fn(Opts(ForExport)) -> Opts(ForExport),
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

Writes the contents of the directory to a path on the host.

pub fn file(
  parent: types.Directory,
  path path: String,
) -> types.File

Retrieve a file at the given path.

pub fn filter(
  parent: types.Directory,
  with with_fn: fn(Opts(FilterFns)) -> Opts(FilterFns),
) -> types.Directory

Return a snapshot with some paths included or excluded

pub fn find_up(
  parent: types.Directory,
  name name: String,
  start start: String,
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

Search up the directory tree for a file or directory, and return its path. If no match, return null

pub fn glob(
  parent: types.Directory,
  pattern pattern: String,
  client client: types.Client,
  then handler: fn(Result(List(String), types.QueryError)) -> a,
) -> a

Returns a list of files and directories that matche the given pattern.

pub fn id(parent: types.Directory) -> types.Directory

A unique identifier for this Directory.

pub fn name(
  parent: types.Directory,
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

Returns the name of the directory.

pub fn none(opts: Opts(a)) -> Opts(a)
pub fn opt_build_args(
  opts: Opts(ForDockerBuild),
  val: List(types.BuildArg),
) -> Opts(ForDockerBuild)
pub fn opt_cmd(
  opts: Opts(ForTerminal),
  val: List(String),
) -> Opts(ForTerminal)
pub fn opt_container(
  opts: Opts(ForTerminal),
  val: types.Container,
) -> Opts(ForTerminal)
pub fn opt_do_not_follow_symlinks(
  opts: Opts(a),
  val: Bool,
) -> Opts(a)
pub fn opt_dockerfile(
  opts: Opts(ForDockerBuild),
  val: String,
) -> Opts(ForDockerBuild)
pub fn opt_dotall(
  opts: Opts(ForSearch),
  val: Bool,
) -> Opts(ForSearch)
pub fn opt_exclude(
  opts: Opts(FilterFns),
  val: List(String),
) -> Opts(FilterFns)
pub fn opt_expected_type(
  opts: Opts(ForExists),
  val: types.ExistsType,
) -> Opts(ForExists)
pub fn opt_experimental_privileged_nesting(
  opts: Opts(ForTerminal),
  val: Bool,
) -> Opts(ForTerminal)
pub fn opt_files_only(
  opts: Opts(ForSearch),
  val: Bool,
) -> Opts(ForSearch)
pub fn opt_gitignore(
  opts: Opts(FilterFns),
  val: Bool,
) -> Opts(FilterFns)
pub fn opt_globs(
  opts: Opts(ForSearch),
  val: List(String),
) -> Opts(ForSearch)
pub fn opt_include(
  opts: Opts(FilterFns),
  val: List(String),
) -> Opts(FilterFns)
pub fn opt_insecure_root_capabilities(
  opts: Opts(ForTerminal),
  val: Bool,
) -> Opts(ForTerminal)
pub fn opt_insensitive(
  opts: Opts(ForSearch),
  val: Bool,
) -> Opts(ForSearch)
pub fn opt_limit(
  opts: Opts(ForSearch),
  val: Int,
) -> Opts(ForSearch)
pub fn opt_literal(
  opts: Opts(ForSearch),
  val: Bool,
) -> Opts(ForSearch)
pub fn opt_multiline(
  opts: Opts(ForSearch),
  val: Bool,
) -> Opts(ForSearch)
pub fn opt_no_init(
  opts: Opts(ForDockerBuild),
  val: Bool,
) -> Opts(ForDockerBuild)
pub fn opt_owner(opts: Opts(a), val: String) -> Opts(a)
pub fn opt_path(
  opts: Opts(ForEntries),
  val: String,
) -> Opts(ForEntries)
pub fn opt_paths(
  opts: Opts(ForSearch),
  val: List(String),
) -> Opts(ForSearch)
pub fn opt_permissions(opts: Opts(a), val: Int) -> Opts(a)
pub fn opt_platform(
  opts: Opts(ForDockerBuild),
  val: String,
) -> Opts(ForDockerBuild)
pub fn opt_secrets(
  opts: Opts(ForDockerBuild),
  val: List(types.Secret),
) -> Opts(ForDockerBuild)
pub fn opt_skip_hidden(
  opts: Opts(ForSearch),
  val: Bool,
) -> Opts(ForSearch)
pub fn opt_skip_ignored(
  opts: Opts(ForSearch),
  val: Bool,
) -> Opts(ForSearch)
pub fn opt_source_root_path(
  opts: Opts(a),
  val: String,
) -> Opts(a)
pub fn opt_target(
  opts: Opts(ForDockerBuild),
  val: String,
) -> Opts(ForDockerBuild)
pub fn opt_wipe(
  opts: Opts(ForExport),
  val: Bool,
) -> Opts(ForExport)
pub fn search(
  parent: types.Directory,
  pattern pattern: String,
  with with_fn: fn(Opts(ForSearch)) -> Opts(ForSearch),
  select select: fn(types.SearchResult) -> List(types.Field),
  client client: types.Client,
  then handler: fn(
    Result(List(types.SearchResult), types.QueryError),
  ) -> a,
) -> a

Searches for content matching the given regular expression or literal string. Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.

pub fn stat(
  parent: types.Directory,
  path path: String,
  with with_fn: fn(Opts(a)) -> Opts(a),
) -> types.Stat

Return file status

pub fn sync(parent: types.Directory) -> types.Directory

Force evaluation in the engine.

pub fn terminal(
  parent: types.Directory,
  with with_fn: fn(Opts(ForTerminal)) -> Opts(ForTerminal),
) -> types.Directory

Opens an interactive terminal in new container with this directory mounted inside.

pub fn with_changes(
  parent: types.Directory,
  changes changes: types.Changeset,
) -> types.Directory

Return a directory with changes from another directory applied to it.

pub fn with_directory(
  parent: types.Directory,
  path path: String,
  source source: types.Directory,
  with with_fn: fn(Opts(FilterFns)) -> Opts(FilterFns),
) -> types.Directory

Return a snapshot with a directory added

pub fn with_error(
  parent: types.Directory,
  err err: String,
) -> types.Directory

Raise an error.

pub fn with_file(
  parent: types.Directory,
  path path: String,
  source source: types.File,
  with with_fn: fn(Opts(a)) -> Opts(a),
) -> types.Directory

Retrieves this directory plus the contents of the given file copied to the given path.

pub fn with_files(
  parent: types.Directory,
  path path: String,
  sources sources: List(types.File),
  with with_fn: fn(Opts(a)) -> Opts(a),
) -> types.Directory

Retrieves this directory plus the contents of the given files copied to the given path.

pub fn with_new_directory(
  parent: types.Directory,
  path path: String,
  with with_fn: fn(Opts(a)) -> Opts(a),
) -> types.Directory

Retrieves this directory plus a new directory created at the given path.

pub fn with_new_file(
  parent: types.Directory,
  path path: String,
  contents contents: String,
  with with_fn: fn(Opts(a)) -> Opts(a),
) -> types.Directory

Return a snapshot with a new file added

pub fn with_patch(
  parent: types.Directory,
  patch patch: String,
) -> types.Directory

Retrieves this directory with the given Git-compatible patch applied.

pub fn with_patch_file(
  parent: types.Directory,
  patch patch: types.File,
) -> types.Directory

Retrieves this directory with the given Git-compatible patch file applied.

pub fn with_symlink(
  parent: types.Directory,
  target target: String,
  link_name link_name: String,
) -> types.Directory

Return a snapshot with a symlink

pub fn with_timestamps(
  parent: types.Directory,
  timestamp timestamp: Int,
) -> types.Directory

Retrieves this directory with all file/dir timestamps set to the given time.

pub fn without_directory(
  parent: types.Directory,
  path path: String,
) -> types.Directory

Return a snapshot with a subdirectory removed

pub fn without_file(
  parent: types.Directory,
  path path: String,
) -> types.Directory

Return a snapshot with a file removed

pub fn without_files(
  parent: types.Directory,
  paths paths: List(String),
) -> types.Directory

Return a snapshot with files removed

Search Document