Documentation ¶
Index ¶
- Constants
- Variables
- type Each
- type Email
- type IP
- type InRange
- type MSISDN
- type MatchRegularExpression
- type Number
- type Required
- type Result
- type ResultSet
- func (s ResultSet) Error() string
- func (s ResultSet) HasErrors() bool
- func (s ResultSet) Result(attribute string) (Result, error)
- func (s ResultSet) ResultErrors() map[string][]string
- func (s ResultSet) Results() map[string]Result
- func (s ResultSet) WithError(attribute string, err error) ResultSet
- func (s ResultSet) WithResult(attribute string, result Result) ResultSet
- type StringLength
- type Time
- func (t Time) ValidateValue(value any) error
- func (t Time) WithFormat(format string) Time
- func (t Time) WithFormatMessage(message string) Time
- func (t Time) WithMax(max TimeFunc) Time
- func (t Time) WithMessage(message string) Time
- func (t Time) WithMin(min TimeFunc) Time
- func (t Time) WithTooBigMessage(message string) Time
- func (t Time) WithTooSmallMessage(message string) Time
- type TimeFunc
- type UUID
- type UUIDVersion
- type UniqueValues
- type Url
- type Validator
Constants ¶
View Source
const AllowAnyURLSchema = "*"
Variables ¶
View Source
var ErrResultNotFound = errors.New("result not found")
Functions ¶
This section is empty.
Types ¶
type Each ¶
type Each struct {
// contains filtered or unexported fields
}
func (Each) ValidateValue ¶
func (Each) WithMessage ¶
type Email ¶
type Email struct {
// contains filtered or unexported fields
}
func (Email) ValidateValue ¶
func (Email) WithMessage ¶
type InRange ¶
type InRange struct {
// contains filtered or unexported fields
}
func NewInRange ¶
func (InRange) ValidateValue ¶
func (InRange) WithMessage ¶
type MSISDN ¶
type MSISDN struct {
// contains filtered or unexported fields
}
func (MSISDN) ValidateValue ¶
func (MSISDN) WithMessage ¶
type MatchRegularExpression ¶
type MatchRegularExpression struct {
// contains filtered or unexported fields
}
func NewMatchRegularExpression ¶
func NewMatchRegularExpression(pattern string) MatchRegularExpression
func (MatchRegularExpression) ValidateValue ¶
func (s MatchRegularExpression) ValidateValue(value any) error
func (MatchRegularExpression) WithMessage ¶
func (s MatchRegularExpression) WithMessage(message string) MatchRegularExpression
type Number ¶
type Number struct {
// contains filtered or unexported fields
}
func (Number) ValidateValue ¶
func (Number) WithNotNumberMessage ¶
func (Number) WithTooBigMessage ¶
func (Number) WithTooSmallMessage ¶
type Required ¶
type Required struct {
// contains filtered or unexported fields
}
func NewRequired ¶
func NewRequired() Required
func (Required) ValidateValue ¶
func (Required) WithAllowZeroValue ¶
func (Required) WithMessage ¶
type ResultSet ¶
type ResultSet struct {
// contains filtered or unexported fields
}
func NewResultSet ¶
func NewResultSet() ResultSet
func (ResultSet) ResultErrors ¶
type StringLength ¶
type StringLength struct {
// contains filtered or unexported fields
}
func NewStringLength ¶
func NewStringLength(min, max int) StringLength
func (StringLength) ValidateValue ¶
func (s StringLength) ValidateValue(value any) error
func (StringLength) WithMessage ¶
func (s StringLength) WithMessage(message string) StringLength
func (StringLength) WithTooLongMessage ¶
func (s StringLength) WithTooLongMessage(message string) StringLength
func (StringLength) WithTooShortMessage ¶
func (s StringLength) WithTooShortMessage(message string) StringLength
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
func (Time) ValidateValue ¶
func (Time) WithFormat ¶
func (Time) WithFormatMessage ¶
func (Time) WithMessage ¶
func (Time) WithTooBigMessage ¶
func (Time) WithTooSmallMessage ¶
type UUID ¶
type UUID struct {
// contains filtered or unexported fields
}
func (UUID) SkipOnEmpty ¶
func (UUID) ValidateValue ¶
func (UUID) WithInvalidVersionMessage ¶
func (UUID) WithMessage ¶
func (UUID) WithVersion ¶
func (s UUID) WithVersion(version UUIDVersion) UUID
type UUIDVersion ¶
type UUIDVersion byte
const ( UUIDVersionV1 UUIDVersion = 1 UUIDVersionV3 UUIDVersion = 3 UUIDVersionV4 UUIDVersion = 4 UUIDVersionV5 UUIDVersion = 5 UUIDVersionV6 UUIDVersion = 6 UUIDVersionV7 UUIDVersion = 7 )
type UniqueValues ¶
type UniqueValues struct {
// contains filtered or unexported fields
}
func NewUniqueValues ¶
func NewUniqueValues() UniqueValues
func (UniqueValues) ValidateValue ¶
func (r UniqueValues) ValidateValue(value any) error
func (UniqueValues) WithMessage ¶
func (r UniqueValues) WithMessage(message string) UniqueValues
type Url ¶
type Url struct {
// contains filtered or unexported fields
}
func (Url) ValidateValue ¶
func (Url) WithEnableIDN ¶
func (Url) WithMessage ¶
func (Url) WithValidScheme ¶
Click to show internal directories.
Click to hide internal directories.