Documentation
¶
Index ¶
Constants ¶
View Source
const ( //PatternURL (forward match) PatternURL string = "^(http|https|ftp):\\/\\/([a-zA-Z0-9][a-zA-Z0-9_-]*(?:\\.[a-zA-Z0-9][a-zA-Z0-9_-]*)+):?(\\d+)?\\/?" //PatternDomain Domain PatternDomain string = "^([a-zA-Z0-9][a-zA-Z0-9_-]*(?:\\.[a-zA-Z0-9][a-zA-Z0-9_-]*)+)$" //PatternEmail E-mail (Allow continuous dot) PatternEmail string = "^[^0-9][.a-zA-Z0-9_]+[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$" //PatternIpv4 IP Address (v4) PatternIpv4 string = "^(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Enum ¶
type Enum struct {
Enums []string
}
Enum validator
type FixedLength ¶
type FixedLength struct {
Fixed int
}
FixedLength validator
func (FixedLength) Check ¶
func (f FixedLength) Check(param string) (string, bool)
Check a param equals fixed length
func (FixedLength) Validate ¶
func (f FixedLength) Validate(param string) bool
Validate for Validator interface
type MaxLength ¶
type MaxLength struct {
Max int
}
MaxLength validator
type MaxNumber ¶
type MaxNumber struct {
Max int
}
MaxNumber validator
type MinLength ¶
type MinLength struct {
Min int
}
MinLength validator
type MinNumber ¶
type MinNumber struct {
Min int
}
MinNumber validator
type NotBlank ¶
type NotBlank struct{}
NotBlank validator
type ObjectID ¶
type ObjectID struct{}
ObjectID validator
type RegExp ¶
type RegExp struct {
Pattern string
}
RegExp Check regular expression
type Time ¶
type Time struct {
Format string
}
Time validator is check a param should be obey by format
type UnixTime ¶
type UnixTime struct{}
UnixTime validator is check a param
func (UnixTime) CheckUnixTime ¶
CheckUnixTime Validate for Validator interface
Click to show internal directories.
Click to hide internal directories.