conform v1.0.0-rc8 Conform.Type behaviour

Defines the behaviour for custom types.

Summary

Callbacks

Converts the .conf value to this data type. Should return the translated value or {:error, reason}

Return a string to produce documentation for the given type based on it’s valid values (if specified). If nil is returned, the documentation specified in the schema will be used instead (if present)

Callbacks

convert(term, arg1)

Specs

convert(term, Conform.Schema.Mapping.t) ::
  {:ok, term} |
  {:error, term}

Converts the .conf value to this data type. Should return the translated value or {:error, reason}

to_doc(term)

Specs

to_doc(term) :: nil | String.t

Return a string to produce documentation for the given type based on it’s valid values (if specified). If nil is returned, the documentation specified in the schema will be used instead (if present).