Tank.Volume (Tank v0.1.0)

Copy Markdown View Source

A pod-level storage volume, mounted into containers via Tank.Mount.

Two sources:

  • :managed (default) — Tank allocates <data_dir>/volumes/<name>.
  • {:host, path} — bind-mount an existing absolute host directory (the escape hatch).

Summary

Functions

Build a validated volume from a map or keyword list.

Like new/1 but raises ArgumentError on invalid input.

Types

source()

@type source() :: :managed | {:host, Path.t()}

t()

@type t() :: %Tank.Volume{name: String.t(), source: source()}

Functions

new(attrs)

@spec new(map() | keyword()) :: {:ok, t()} | {:error, term()}

Build a validated volume from a map or keyword list.

new!(attrs)

@spec new!(map() | keyword()) :: t()

Like new/1 but raises ArgumentError on invalid input.