Documentation ¶
Index ¶
- Variables
- func Validate(msg proto.Message) (bool, error)
- func ValidateDouble(value protoreflect.Value, rules *validate.DoubleRules) (bool, []error)
- func ValidateDynamic(m *dynamicpb.Message) (bool, error)
- func ValidateFloat(value protoreflect.Value, rules *validate.FloatRules) (bool, []error)
- func ValidateInt32(value protoreflect.Value, rules *validate.Int32Rules) (bool, []error)
- func ValidateInt64(value protoreflect.Value, rules *validate.Int64Rules) (bool, []error)
- func ValidateString(value protoreflect.Value, rules *validate.StringRules) (bool, []error)
- func ValidateUInt32(value protoreflect.Value, rules *validate.UInt32Rules) (bool, []error)
- func ValidateUInt64(value protoreflect.Value, rules *validate.UInt64Rules) (bool, []error)
- type ValidateError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorConst = errors.New("value does not match the const rule") ErrorLt = errors.New("value is not less than the specified value") ErrorLte = errors.New("value is not less than or equal to the specified value") ErrorGt = errors.New("value is not greater than the specified value") ErrorGte = errors.New("value is not greater than or equal to the specified value") ErrorLen = errors.New("value does not match the specified length") ErrorMinLen = errors.New("value is shorter than the minimum length") ErrorMaxLen = errors.New("value is longer than the maximum length") ErrorLenBytes = errors.New("byte length does not match the specified length") ErrorMinBytes = errors.New("byte length is less than the minimum specified") ErrorMaxBytes = errors.New("byte length exceeds the maximum specified") ErrorPattern = errors.New("value does not match the specified pattern") ErrorPrefix = errors.New("value does not have the specified prefix") ErrorSuffix = errors.New("value does not have the specified suffix") ErrorContains = errors.New("value does not contain the specified substring") ErrorNotContains = errors.New("value contains a prohibited substring") ErrorIn = errors.New("value is not in the specified set") ErrorNotIn = errors.New("value is in the not_in set") ErrorInvalid = errors.New("value is not valid") ErrorInvalidEmail = errors.New("value is not a valid email address") ErrorHostnameTooLong = errors.New("hostname cannot exceed 253 characters") ErrorHostnameInvalidPart = errors.New("hostname part must be non-empty and cannot exceed 63 characters") ErrorHostnamePartBeginWithHyphens = errors.New("hostname parts cannot begin with hyphens") ErrorHostnamePartEndsWithHyphens = errors.New("hostname parts cannot end with hyphens") ErrorInvalidIp = errors.New("value is not a valid ip address") ErrorInvalidIpv4 = errors.New("value is not a valid ipv4 address") ErrorInvalidIpv6 = errors.New("value is not a valid ipv6 address") ErrorInvalidUri = errors.New("value is not a valid uri") )
Functions ¶
func ValidateDouble ¶
func ValidateDouble(value protoreflect.Value, rules *validate.DoubleRules) (bool, []error)
func ValidateFloat ¶
func ValidateFloat(value protoreflect.Value, rules *validate.FloatRules) (bool, []error)
func ValidateInt32 ¶
func ValidateInt32(value protoreflect.Value, rules *validate.Int32Rules) (bool, []error)
func ValidateInt64 ¶
func ValidateInt64(value protoreflect.Value, rules *validate.Int64Rules) (bool, []error)
func ValidateString ¶
func ValidateString(value protoreflect.Value, rules *validate.StringRules) (bool, []error)
func ValidateUInt32 ¶
func ValidateUInt32(value protoreflect.Value, rules *validate.UInt32Rules) (bool, []error)
func ValidateUInt64 ¶
func ValidateUInt64(value protoreflect.Value, rules *validate.UInt64Rules) (bool, []error)
Types ¶
type ValidateError ¶
type ValidateError struct {
// contains filtered or unexported fields
}
func (*ValidateError) Err ¶
func (v *ValidateError) Err() error
func (*ValidateError) Error ¶
func (v *ValidateError) Error() string
func (*ValidateError) Func ¶
func (v *ValidateError) Func(name protoreflect.Name, f func() (bool, []error))
func (*ValidateError) Ok ¶
func (v *ValidateError) Ok() bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.