ChoreRunner.Input (chore_runner v0.5.2)

Summary

Types

input_options()

@type input_options() :: [validators: [validator_function()], description: String.t()]

input_type()

@type input_type() :: :string | :int | :float | :file | :bool

reason()

@type reason() :: atom() | String.t()

t()

@type t() :: {input_type(), atom(), input_options()}

validator_function()

@type validator_function() ::
  (term() -> {:ok, term()} | :ok | true | {:error, reason()} | nil | false)

Functions

bool(name, opts \\ [])

@spec bool(atom(), input_options()) :: t()

file(name, opts \\ [])

@spec file(atom(), input_options()) :: t()

float(name, opts \\ [])

@spec float(atom(), input_options()) :: t()

int(name, opts \\ [])

@spec int(atom(), input_options()) :: t()

string(name, opts \\ [])

@spec string(atom(), input_options()) :: t()

types()

valid_type(type)

(macro)

validate_field(type, value)