Documentation
¶
Index ¶
- func First(e ...error) error
- type AssertFunc
- type Assertion
- func (a *Assertion) Alpha() *Assertion
- func (a *Assertion) AlphaNumeric() *Assertion
- func (a *Assertion) Email() *Assertion
- func (a *Assertion) Float64() (float64, error)
- func (a *Assertion) Int() (int, error)
- func (a *Assertion) MaxLen(val int) *Assertion
- func (a *Assertion) MaxNum(val int) *Assertion
- func (a *Assertion) MinLen(val int) *Assertion
- func (a *Assertion) MinNum(val int) *Assertion
- func (a *Assertion) NotEmpty() *Assertion
- func (a *Assertion) Regex(val string) *Assertion
- func (a *Assertion) String() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssertFunc ¶
type AssertFunc func(interface{}) error
type Assertion ¶
type Assertion struct {
// contains filtered or unexported fields
}
func (*Assertion) Alpha ¶
Alpha asserts that the source (formatted as string) only containes letters a-z and A-Z
func (*Assertion) AlphaNumeric ¶
AlphaNumeric asserts that the source (formatted as string) only containes characters a-z, A-Z and 0-9
func (*Assertion) Email ¶
Email asserts that the source (formatted as string) matches an email pattern
func (*Assertion) Float64 ¶
Float runs all assertions and returns the source as a float64 and errors if any
func (*Assertion) MaxLen ¶
MaxLen asserts that the character length of the source (formatted as string) is less than or equal to the value
func (*Assertion) MaxNum ¶
MaxNum asserts that the value of the source (formatted as int) is greater than or equal to the value
func (*Assertion) MinLen ¶
MinLen asserts that the character length of the source (formatted as string) is greater than or equal to the value
func (*Assertion) MinNum ¶
MinNum asserts that the value of the source (formatted as int) is less than or equal to the value
func (*Assertion) NotEmpty ¶
NotEmpty asserts that the string representation of the source is not equal to ""
