Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataType ¶
type DataType struct { }
DataType represents a datatype that validates and formats an email address Uses mail.ParseAddress from the "net/mail" package to parse the input and verify that it's a valid email Only supports raw email addresses. Doesn't support email addresses with Names e.g. "Barry Gibbs <bg@example.com>" is an invalid datatype It always formats the email address at storage to always be in lowercase and no leading or trailing spaces Don't use a regex here because there's built-in functionality that already does the parsing we need and better to use standard library than re-implement in
func Type ¶
func Type() *DataType
Type returns a datatype that implements the field.DataType interface
func (*DataType) Type ¶
func (t *DataType) Type() interface{}
Type returns string to satisfy the field.DataType interface
func (*DataType) ValidateAndFormat ¶
ValidateAndFormat calls Valid and then Format if valid