Documentation ¶
Index ¶
- Variables
- type FieldValidations
- type StructValidations
- func (s *StructValidations) AddFieldValidationError(fieldName string, validationError error)
- func (s *StructValidations) AddFieldValidations(fieldName string, fieldValidations *FieldValidations)
- func (s *StructValidations) AddNestedStructValidations(fieldName string, nestedStructValidations *StructValidations)
- func (s *StructValidations) GetFieldsValidations() *map[string]*FieldValidations
- func (s *StructValidations) GetNestedStructsValidations() *map[string]*StructValidations
- func (s *StructValidations) GetReflection() *goreflect.Reflection
- func (s *StructValidations) GetStructTypeName() string
- func (s *StructValidations) HasFailed() bool
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type FieldValidations ¶ added in v0.5.0
type FieldValidations struct {
// contains filtered or unexported fields
}
FieldValidations is a struct that holds the field validations for the generated validations of a struct
func NewFieldValidations ¶ added in v0.5.0
func NewFieldValidations() *FieldValidations
NewFieldValidations creates a new FieldValidations struct
func (*FieldValidations) AddValidationError ¶ added in v0.5.0
func (f *FieldValidations) AddValidationError( validationError error, )
AddValidationError adds a validation error to the field
func (*FieldValidations) GetErrors ¶ added in v0.5.0
func (f *FieldValidations) GetErrors() *[]error
GetErrors returns the field errors
func (*FieldValidations) HasFailed ¶ added in v0.5.0
func (f *FieldValidations) HasFailed() bool
HasFailed returns true if there are failed validations
type StructValidations ¶ added in v0.5.0
type StructValidations struct {
// contains filtered or unexported fields
}
StructValidations is a struct that holds the struct validations for the generated validations of a struct
func NewNestedStructValidations ¶ added in v0.5.10
func NewNestedStructValidations( fieldName string, instance interface{}, ) (*StructValidations, error)
NewNestedStructValidations creates a new nested StructValidations struct
func NewStructValidations ¶ added in v0.5.0
func NewStructValidations(instance interface{}) (*StructValidations, error)
NewStructValidations creates a new StructValidations struct
func (*StructValidations) AddFieldValidationError ¶ added in v0.5.0
func (s *StructValidations) AddFieldValidationError( fieldName string, validationError error, )
AddFieldValidationError adds a validation error to the field
func (*StructValidations) AddFieldValidations ¶ added in v0.5.0
func (s *StructValidations) AddFieldValidations( fieldName string, fieldValidations *FieldValidations, )
AddFieldValidations sets the fields validations to the struct
func (*StructValidations) AddNestedStructValidations ¶ added in v0.5.0
func (s *StructValidations) AddNestedStructValidations( fieldName string, nestedStructValidations *StructValidations, )
AddNestedStructValidations sets the nested struct fields validations to the struct
func (*StructValidations) GetFieldsValidations ¶ added in v0.5.0
func (s *StructValidations) GetFieldsValidations() *map[string]*FieldValidations
GetFieldsValidations returns the fields validations
func (*StructValidations) GetNestedStructsValidations ¶ added in v0.5.0
func (s *StructValidations) GetNestedStructsValidations() *map[string]*StructValidations
GetNestedStructsValidations returns the nested structs validations
func (*StructValidations) GetReflection ¶ added in v0.5.10
func (s *StructValidations) GetReflection() *goreflect.Reflection
GetReflection returns the reflection of the struct
func (*StructValidations) GetStructTypeName ¶ added in v0.5.10
func (s *StructValidations) GetStructTypeName() string
GetStructTypeName returns the type name of the struct
func (*StructValidations) HasFailed ¶ added in v0.5.0
func (s *StructValidations) HasFailed() bool
HasFailed returns true if there are failed validations