Documentation ¶
Index ¶
- Variables
- func Configure(config Config) error
- func Input() *input
- func Max(max any) any
- func Min(min any) any
- func Range(min any, max any) any
- type BoolFunc
- type BoolValidator
- type Config
- type DataMax
- type DataMin
- type DataRange
- type InputBool
- type InputInt
- func (i *InputInt) Default(value int) *InputInt
- func (i *InputInt) Func(fn func(field string, value int, input typed.Typed, res *Result) int) *InputInt
- func (i *InputInt) Max(max int) *InputInt
- func (i *InputInt) Min(min int) *InputInt
- func (i *InputInt) Range(min int, max int) *InputInt
- func (i *InputInt) Required() *InputInt
- type InputString
- func (i *InputString) Clone(field string) *InputString
- func (i *InputString) Convert(fn StringConverter) *InputString
- func (i *InputString) Default(value string) *InputString
- func (i *InputString) Func(fn StringFuncValidator) *InputString
- func (i *InputString) Length(min int, max int) *InputString
- func (i *InputString) Pattern(pattern string) *InputString
- func (i *InputString) Required() *InputString
- type InputValidator
- type IntFunc
- type IntMax
- type IntMin
- type IntRange
- type IntValidator
- type Invalid
- type InvalidField
- type Meta
- type Pool
- type Result
- type StringConverter
- type StringFunc
- type StringFuncValidator
- type StringLen
- type StringPattern
- type StringValidator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Required = M(utils.VAL_REQUIRED, "required") InvalidStringType = M(utils.VAL_STRING_TYPE, "must be a string") InvalidStringLength = M(utils.VAL_STRING_LEN, "must be between %d and %d characters") InvalidStringPattern = M(utils.VAL_STRING_PATTERN, "is not valid") InvalidIntType = M(utils.VAL_INT_TYPE, "must be a number") InvalidIntMin = M(utils.VAL_INT_MIN, "must be greater or equal to %d") InvalidIntMax = M(utils.VAL_INT_MAX, "must be less than or equal to %d") InvalidIntRange = M(utils.VAL_INT_RANGE, "must be between %d and %d") InvalidBoolType = M(utils.VAL_BOOL_TYPE, "must be true or false") )
Functions ¶
Types ¶
type BoolValidator ¶
type InputBool ¶
type InputBool struct {
// contains filtered or unexported fields
}
type InputInt ¶
type InputInt struct {
// contains filtered or unexported fields
}
type InputString ¶
type InputString struct {
// contains filtered or unexported fields
}
func String ¶
func String(field string) *InputString
func (*InputString) Clone ¶
func (i *InputString) Clone(field string) *InputString
func (*InputString) Convert ¶
func (i *InputString) Convert(fn StringConverter) *InputString
func (*InputString) Default ¶
func (i *InputString) Default(value string) *InputString
func (*InputString) Func ¶
func (i *InputString) Func(fn StringFuncValidator) *InputString
func (*InputString) Length ¶
func (i *InputString) Length(min int, max int) *InputString
func (*InputString) Pattern ¶
func (i *InputString) Pattern(pattern string) *InputString
func (*InputString) Required ¶
func (i *InputString) Required() *InputString
type InputValidator ¶
type InputValidator interface {
// contains filtered or unexported methods
}
type IntValidator ¶
type InvalidField ¶
type StringConverter ¶
type StringFunc ¶
type StringFunc struct {
// contains filtered or unexported fields
}
func (StringFunc) Clone ¶
func (v StringFunc) Clone(field string) StringValidator
type StringFuncValidator ¶
type StringLen ¶
type StringLen struct {
// contains filtered or unexported fields
}
func (StringLen) Clone ¶
func (v StringLen) Clone(field string) StringValidator
type StringPattern ¶
type StringPattern struct {
// contains filtered or unexported fields
}
func (StringPattern) Clone ¶
func (v StringPattern) Clone(field string) StringValidator
type StringValidator ¶
Click to show internal directories.
Click to hide internal directories.