Documentation ¶
Index ¶
- Variables
- func NewFormatWrongMsg(format string) *ui.TemplateMessage
- func NewTooBigMsg(max string) *ui.TemplateMessage
- func NewTooLongMsg(max string) *ui.TemplateMessage
- func NewTooShortMsg(min string) *ui.TemplateMessage
- func NewTooSmallMsg(min string) *ui.TemplateMessage
- func NewWrongLengthMsg(length string) *ui.TemplateMessage
- func SetTranslatedFieldLabels(form validator.Fields, module string, labels map[string]string)
- func ValidateInt64InList(form validator.Fields, value int64, field string, l *Int64List)
- func ValidateInt64Range(form validator.Fields, value int64, field string, min int64, max int64)
- func ValidateIntInList(form validator.Fields, value int, field string, l *IntList)
- func ValidateIntRange(form validator.Fields, value int, field string, min int, max int)
- func ValidateListLength(form validator.Fields, value interface{}, field string, min int, max int)
- func ValidateRequiredFloat32(form validator.Fields, value float32, field string)
- func ValidateRequiredFloat64(form validator.Fields, value float64, field string)
- func ValidateRequiredInt(form validator.Fields, value int, field string)
- func ValidateRequiredInt64(form validator.Fields, value int64, field string)
- func ValidateRequiredInterface(form validator.Fields, value interface{}, field string)
- func ValidateRequiredList(form validator.Fields, value interface{}, field string)
- func ValidateRequiredPointer(form validator.Fields, value interface{}, field string)
- func ValidateRequiredString(form validator.Fields, value string, field string)
- func ValidateRequiredTime(form validator.Fields, value time.Time, field string)
- func ValidateStringInList(form validator.Fields, value string, field string, l *StringList)
- func ValidateStringLength(form validator.Fields, value string, field string, min int, max int)
- type Int64List
- type IntList
- type StringList
Constants ¶
This section is empty.
Variables ¶
var MsgDuplicated = ui.NewMessage("herbgo.form", " {{label}} is duplicated.")
MsgDuplicated messages that shows field is duplicated.
var MsgIncorrect = ui.NewMessage("herbgo.form", "{{label}} is incorrect.")
MsgIncorrect messages that shows field is incorrect.
var MsgInvalide = ui.NewMessage("herbgo.form", "{{label}} is invalid.")
MsgInvalide messages that shows field is invalid.
var MsgNotMatch = ui.NewMessage("herbgo.form", "{{label}} is not match.")
MsgNotMatch messages that shows field is not match.
var MsgRequired = ui.NewMessage("herbgo.form", "{{label}} is required.")
MsgRequired message that shows field is required
Functions ¶
func NewFormatWrongMsg ¶
func NewFormatWrongMsg(format string) *ui.TemplateMessage
NewFormatWrongMsg create new message that shows field format wrong with given format.
func NewTooBigMsg ¶
func NewTooBigMsg(max string) *ui.TemplateMessage
NewTooBigMsg create new message that shows field is too big with given max value.
func NewTooLongMsg ¶
func NewTooLongMsg(max string) *ui.TemplateMessage
NewTooLongMsg create new message that shows field is too long with given max length.
func NewTooShortMsg ¶
func NewTooShortMsg(min string) *ui.TemplateMessage
NewTooShortMsg create new message that shows field is too show with given min length.
func NewTooSmallMsg ¶
func NewTooSmallMsg(min string) *ui.TemplateMessage
NewTooSmallMsg create new message that shows field is too small with given min value.
func NewWrongLengthMsg ¶
func NewWrongLengthMsg(length string) *ui.TemplateMessage
NewWrongLengthMsg create new message that shows field length wrong with given length.
func SetTranslatedFieldLabels ¶
SetTranslatedFieldLabels set translated field labels to form.
func ValidateInt64InList ¶
ValidateInt64InList validate required string field
func ValidateInt64Range ¶
ValidateInt64Range validate int value range
func ValidateIntInList ¶
ValidateIntInList validate required string field
func ValidateIntRange ¶
ValidateIntRange validate int value range
func ValidateListLength ¶
ValidateListLength validate list length
func ValidateRequiredFloat32 ¶
ValidateRequiredFloat32 validate required int field
func ValidateRequiredFloat64 ¶
ValidateRequiredFloat64 validate required int64 field
func ValidateRequiredInt ¶
ValidateRequiredInt validate required int field
func ValidateRequiredInt64 ¶
ValidateRequiredInt64 validate required int64 field
func ValidateRequiredInterface ¶
ValidateRequiredInterface validate required interface field
func ValidateRequiredList ¶
ValidateRequiredList validate required list field
func ValidateRequiredPointer ¶
ValidateRequiredPointer validate required pointer field
func ValidateRequiredString ¶
ValidateRequiredString validate required string field
func ValidateRequiredTime ¶
ValidateRequiredTime validate required int64 field
func ValidateStringInList ¶
func ValidateStringInList(form validator.Fields, value string, field string, l *StringList)
ValidateStringInList validate required string field
Types ¶
type StringList ¶
StringList string list
func NewStringList ¶
func NewStringList(values ...string) *StringList
NewStringList create new string list
func (*StringList) Has ¶
func (l *StringList) Has(value string) bool
Has check if given value in list