Magik.Validator.validate
You're seeing just the function
validate
, go back to Magik.Validator module for more information.
Specs
Validate value against list of validations.
iex(13)> Magik.Validator.validate("email@g.c", type: :string, format: ~r/.+@.+.[a-z]{2,10}/)
{:error, "format not matched"}
All supported validations:
type
: validate datatypeformat
: check if binary value matched given regexnumber
: validate number valuelength
: validate length of supported types. Seevalidate_length/2
for more details.in
: validate inclusionnot_in
: validate exclusionfunc
: custom validation function follows specfunc(any()):: :ok | {:error, message::String.t()}