|
|
@ -31,6 +31,10 @@ type FieldLevel interface { |
|
|
|
// NOTE: when not successful ok will be false, this can happen when a nested struct is nil and so the field
|
|
|
|
// NOTE: when not successful ok will be false, this can happen when a nested struct is nil and so the field
|
|
|
|
// could not be retrieved because it didn't exist.
|
|
|
|
// could not be retrieved because it didn't exist.
|
|
|
|
GetStructFieldOK() (reflect.Value, reflect.Kind, bool) |
|
|
|
GetStructFieldOK() (reflect.Value, reflect.Kind, bool) |
|
|
|
|
|
|
|
// return cache field
|
|
|
|
|
|
|
|
CField() *cField |
|
|
|
|
|
|
|
// return cache tag
|
|
|
|
|
|
|
|
CTag() *cTag |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var _ FieldLevel = new(validate) |
|
|
|
var _ FieldLevel = new(validate) |
|
|
@ -49,3 +53,13 @@ func (v *validate) Param() string { |
|
|
|
func (v *validate) GetStructFieldOK() (reflect.Value, reflect.Kind, bool) { |
|
|
|
func (v *validate) GetStructFieldOK() (reflect.Value, reflect.Kind, bool) { |
|
|
|
return v.getStructFieldOKInternal(v.slflParent, v.flParam) |
|
|
|
return v.getStructFieldOKInternal(v.slflParent, v.flParam) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Param returns cache field
|
|
|
|
|
|
|
|
func (v *validate) CField() *cField { |
|
|
|
|
|
|
|
return v.cf |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Param returns cache tag
|
|
|
|
|
|
|
|
func (v *validate) CTag() *cTag { |
|
|
|
|
|
|
|
return v.ct |
|
|
|
|
|
|
|
} |
|
|
|