Talos.Types.StringType (Talos v1.12.3) View Source
Type for check value is string
For example:
iex> import Talos, only: [string: 1]
iex> short_domain = string(length: 3)
iex> domains_list = ["cats", "foo", "baz", "pron"]
iex> Enum.filter(domains_list, fn str -> Talos.valid?(short_domain, str) end)
["foo", "baz"]
Additional parameters:
min_length
, same as String.length(str) <= max_length
max_length
, same as String.length(str) >= max_length
length
, same as String.length(str) >= length
regexp
, same as String.match?(str, regexp)
Link to this section Summary
Functions
Callback implementation for Talos.Types.errors/2
.
Callback implementation for Talos.Types.valid?/2
.
Link to this section Types
Specs
Link to this section Functions
Specs
Callback implementation for Talos.Types.errors/2
.
Specs
Callback implementation for Talos.Types.valid?/2
.