View Source Dagger.File (dagger v0.15.1)

A file.

Summary

Functions

Retrieves the contents of the file.

Return the file'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.

Writes the file to a file path on the host.

A unique identifier for this File.

Retrieves the name of the file.

Retrieves the size of the file, in bytes.

Force evaluation in the engine.

Retrieves this file with its name set to the given name.

Retrieves this file with its created/modified timestamps set to the given time.

Types

t()

@type t() :: %Dagger.File{client: term(), query_builder: term()}

Functions

contents(file)

@spec contents(t()) :: {:ok, String.t()} | {:error, term()}

Retrieves the contents of the file.

digest(file, optional_args \\ [])

@spec digest(t(), [{:exclude_metadata, boolean() | nil}]) ::
  {:ok, String.t()} | {:error, term()}

Return the file'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.

export(file, path, optional_args \\ [])

@spec export(t(), String.t(), [{:allow_parent_dir_path, boolean() | nil}]) ::
  {:ok, String.t()} | {:error, term()}

Writes the file to a file path on the host.

id(file)

@spec id(t()) :: {:ok, Dagger.FileID.t()} | {:error, term()}

A unique identifier for this File.

name(file)

@spec name(t()) :: {:ok, String.t()} | {:error, term()}

Retrieves the name of the file.

size(file)

@spec size(t()) :: {:ok, integer()} | {:error, term()}

Retrieves the size of the file, in bytes.

sync(file)

@spec sync(t()) :: {:ok, t()} | {:error, term()}

Force evaluation in the engine.

with_name(file, name)

@spec with_name(t(), String.t()) :: t()

Retrieves this file with its name set to the given name.

with_timestamps(file, timestamp)

@spec with_timestamps(t(), integer()) :: t()

Retrieves this file with its created/modified timestamps set to the given time.