Batamanta.Validator (batamanta v1.5.0)

Copy Markdown View Source

Validates Batamanta configuration for supported combinations.

This module ensures that the combination of OS, architecture, OTP version, Elixir version, and execution mode is valid and supported.

  • :macos - macOS 11+ (Big Sur and later)

  • :linux - Linux with glibc (Debian, Ubuntu, Arch, Fedora, etc.)

  • :linux_musl - Linux with musl (Alpine)

  • :windows - Windows 10+ (limited support)

  • :x86_64 - Intel/AMD 64-bit

  • :aarch64 - ARM 64-bit (Apple Silicon, ARM servers)

  • OTP 25+ (minimum supported)

  • OTP 26, 27, 28+ (recommended)

  • Elixir 1.15+ (minimum supported)

  • Elixir 1.16, 1.17, 1.18+ (recommended)

  • :cli - Command-line interface (all platforms)

  • :tui - Text user interface (Unix only)

  • :daemon - Background daemon (Unix only)

    iex> Batamanta.Validator.validate!(os: "linux", arch: "x86_64", mode: :cli) :ok

    iex> Batamanta.Validator.validate!(os: "windows", mode: :tui) ** (ArgumentError) TUI mode is not supported on Windows

Summary

Functions

Returns a human-readable compatibility matrix.

Returns a list of all supported combinations.

Checks if a specific combination is valid.

Validates the configuration and returns :ok or raises an error.

Types

validation_config()

@type validation_config() :: [
  os: String.t() | :auto,
  arch: String.t() | :auto,
  mode: atom(),
  otp_version: String.t(),
  elixir_version: String.t()
]

Functions

compatibility_matrix()

@spec compatibility_matrix() :: String.t()

Returns a human-readable compatibility matrix.

supported_combinations()

@spec supported_combinations() :: [map()]

Returns a list of all supported combinations.

valid_combination?(arg1)

@spec valid_combination?(map()) :: boolean()

Checks if a specific combination is valid.

validate!(config)

@spec validate!(validation_config()) :: :ok | no_return()

Validates the configuration and returns :ok or raises an error.

  • config - Keyword list with validation parameters

    iex> validate!(os: "linux", arch: "x86_64", mode: :cli) :ok