Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DateValidatorTag is the tag identifier for date validation (`validate:"date={formats}"`). DateValidatorTag = "date" // Supported date formats DateOnly = "dateonly" // DateOnly represents the 'dateonly' format (YYYY-MM-DD) (`validate:"date=dateonly"`). DateTime = "datetime" // DateTime represents the 'datetime' format (YYYY-MM-DD HH:MM:SS) (`validate:"date=datetime"`). RFC3339 = "rfc3339" // RFC3339 represents the 'rfc3339' format (YYYY-MM-DDTHH:MM:SSZ, YYYY-MM-DDTHH:MM:SS±HH:MM) (`validate:"date=rfc3339"`). TimeOnly = "timeonly" // TimeOnly represents the 'timeonly' format (HH:MM:SS) (`validate:"date=timeonly"`). )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DateValidator ¶
type DateValidator struct{}
DateValidator implements the CustomValidator interface for date validation.
func (*DateValidator) Func ¶
func (*DateValidator) Func() validator.Func
Func returns the validation function for date validation.
func (*DateValidator) Tag ¶
func (*DateValidator) Tag() string
Tag returns the tag identifier for the date validator.
func (*DateValidator) Translation ¶
func (*DateValidator) Translation() (string, validator.TranslationFunc)
Translation returns the translation text and custom translation function for the date validator.
Click to show internal directories.
Click to hide internal directories.