evalidate (evalidate v0.1.0)
View SourceSummary
Types
-type key() :: term().
-type option() :: {tag_key, char()}.
-type options() :: [option()].
-type validator() :: [validator_fun()] | validator_fun().
-type validator_fun() :: fun((Value :: term()) -> validator_return()).
Functions
-spec binary() -> validator_fun().
-spec boolean() -> validator_fun().
-spec date() -> validator_fun().
-spec date(Opts :: evalidate_calendar:options()) -> validator_fun().
-spec datetime() -> validator_fun().
-spec datetime(Opts :: evalidate_calendar:options()) -> validator_fun().
-spec default(Default :: term()) -> validator_fun().
-spec discard() -> validator_fun().
-spec discard(Validator :: validator()) -> validator_fun().
-spec email() -> validator_fun().
-spec enum(L :: [term()]) -> validator_fun().
-spec eq(N :: integer()) -> validator_fun().
-spec equal(String :: unicode:chardata()) -> validator_fun().
-spec equal(String :: unicode:chardata(), IgnoreCase :: boolean()) -> validator_fun().
-spec float() -> validator_fun().
-spec ge(N :: number()) -> validator_fun().
-spec gt(N :: number()) -> validator_fun().
-spec integer() -> validator_fun().
-spec invalid() -> validator_fun().
-spec invalid(Reason :: term()) -> validator_fun().
-spec iolist() -> validator_fun().
-spec iolist_max_size(Max :: non_neg_integer()) -> validator_fun().
-spec iolist_min_size(Min :: non_neg_integer()) -> validator_fun().
-spec iolist_size(Min :: non_neg_integer(), Max :: non_neg_integer()) -> validator_fun().
-spec ip() -> validator_fun().
-spec ip(Opts :: evalidate_net:options()) -> validator_fun().
-spec ipv4() -> validator_fun().
-spec ipv4(Opts :: evalidate_net:options()) -> validator_fun().
-spec ipv6() -> validator_fun().
-spec ipv6(Opts :: evalidate_net:options()) -> validator_fun().
-spec json() -> validator_fun().
-spec json(Encoder :: json:encoder()) -> validator_fun().
-spec le(N :: number()) -> validator_fun().
-spec length(Min :: non_neg_integer(), Max :: non_neg_integer()) -> validator_fun().
-spec list() -> validator_fun().
-spec list(Layout :: [validator()]) -> validator_fun().
-spec list_length(Min :: non_neg_integer(), Max :: non_neg_integer()) -> validator_fun().
-spec list_max_length(Max :: non_neg_integer()) -> validator_fun().
-spec list_min_length(Min :: non_neg_integer()) -> validator_fun().
-spec list_of(validator()) -> validator_fun().
-spec lowercase() -> validator_fun().
-spec lt(N :: number()) -> validator_fun().
-spec map() -> validator_fun().
-spec map(Schema :: schema()) -> validator_fun().
-spec map(Schema :: schema(), Opts :: options()) -> validator_fun().
-spec map_max_size(Max :: non_neg_integer()) -> validator_fun().
-spec map_merge(M :: map()) -> validator_fun().
-spec map_min_size(Min :: non_neg_integer()) -> validator_fun().
-spec map_size(Min :: non_neg_integer(), Max :: non_neg_integer()) -> validator_fun().
-spec match(term()) -> validator_fun().
-spec max(Max :: number()) -> validator_fun().
-spec max_length(Max :: non_neg_integer()) -> validator_fun().
-spec min(Min :: number()) -> validator_fun().
-spec min_length(Min :: non_neg_integer()) -> validator_fun().
-spec ne(N :: integer()) -> validator_fun().
-spec negate(Validator :: validator()) -> validator_fun().
-spec non_empty() -> validator_fun().
-spec nullable() -> validator_fun().
-spec nullable(Validator :: validator()) -> validator_fun().
-spec number() -> validator_fun().
-spec one_of(ValidatorList :: [validator()]) -> validator_fun().
-spec optional() -> validator_fun().
-spec optional(validator()) -> validator_fun().
-spec pad(Length, Dir, Char) -> validator_fun() when Length :: integer(), Dir :: leading | trailing | both, Char :: string:grapheme_cluster().
-spec port() -> validator_fun().
-spec prefix(Prefix :: unicode:chardata()) -> validator_fun().
-spec prefix(Prefix :: unicode:chardata(), RemovePrefix :: boolean()) -> validator_fun().
-spec range(Min :: non_neg_integer() | infinity, Max :: non_neg_integer() | infinity) -> validator_fun().
-spec re(Regex, Opts) -> validator_fun() when Regex :: re:mp() | iodata() | unicode:charlist(), Opts :: re:options().
-spec required() -> validator_fun().
-spec required(Validator :: validator()) -> validator_fun().
-spec return() -> validator_fun().
-spec return(Value :: term()) -> validator_fun().
-spec similar(String :: unicode:chardata(), Confidence :: float()) -> validator_fun().
-spec sort() -> validator_fun().
-spec sort(Fn) -> validator_fun() when Fn :: fun((T, T) -> boolean()).
-spec suffix(Suffix :: unicode:chardata()) -> validator_fun().
-spec suffix(Suffix :: unicode:chardata(), RemoveSuffix :: boolean()) -> validator_fun().
-spec time() -> validator_fun().
-spec time(Opts :: evalidate_calendar:options()) -> validator_fun().
-spec titlecase() -> validator_fun().
-spec trim() -> validator_fun().
-spec trim(leading | trailing | both) -> validator_fun().
-spec trim(leading | trailing | both, Char :: [string:grapheme_cluster()]) -> validator_fun().
-spec tuple() -> validator_fun().
-spec tuple(Layout :: tuple()) -> validator_fun().
-spec tuple_max_size(Max :: non_neg_integer()) -> validator_fun().
-spec tuple_min_size(Min :: non_neg_integer()) -> validator_fun().
-spec tuple_size(Min :: non_neg_integer(), Max :: non_neg_integer()) -> validator_fun().
-spec unicode(Encoding :: unicode:encoding()) -> validator_fun().
-spec unique() -> validator_fun().
-spec uppercase() -> validator_fun().
-spec usort() -> validator_fun().
-spec usort(Fn) -> validator_fun() when Fn :: fun((T, T) -> boolean()).
-spec utf8() -> validator_fun().