PasswordValidator.Validator behaviour (Password Validator v0.5.2)

View Source

Specifies the behaviour needed to implement a custom (or built-in) validator.

Summary

Callbacks

Validate the given string and return :ok or {:error, errors} where errors is a list.

Types

error_info()

@type error_info() :: String.t() | {String.t(), Keyword.t()}

Callbacks

validate(t, t)

@callback validate(String.t(), Keyword.t()) :: :ok | {:error, [error_info(), ...]}

Validate the given string and return :ok or {:error, errors} where errors is a list.

Functions

return_errors_or_ok(results)

@spec return_errors_or_ok(list()) :: :ok | {:error, [...]}

return_errors_or_ok_old(results)