Documentation ¶
Index ¶
Constants ¶
View Source
const ( MESSAGE_REQUIRED = "Validation: Field '%s' is required" MESSAGE_BLANK = "Validation: Field '%s' failed is %s" MESSAGE_EMAIL = "Validation: Field '%s' is invalid" MESSAGE_CPF_AND_CNPJ = "Validation: Field '%s' is invalid" MESSAGE_MIM_MAX = "Validation: Field '%s' failed the %s length of %s characters" MESSAGE_GREATE_THEN = "Validation: Field '%s' failed greater than or equal = '%s'" MESSAGE_LESS_THEN = "Validation: Field '%s' failed less than or equal = '%s'" MESSAGE_DEFAULT = "Validation: Field '%s' failed on the '%s = %s'" MESSAGE_DEFAULT_NO_PARAM = "Validation: Field '%s' failed on the '%s'" )
Variables ¶
This section is empty.
Functions ¶
func MessageValidation ¶
func MessageValidation(fe validator.FieldError) string
Types ¶
type FieldValidation ¶
type Service ¶
type Service struct { }
func (*Service) Struct ¶ added in v1.0.1
func (s *Service) Struct(strt interface{}) (messageValidate []FieldValidation, err error)
type Validate ¶ added in v1.0.1
type Validate interface {
Struct(strt interface{}) (messageValidate []FieldValidation, err error)
}
func NewValidate ¶
func NewValidate() Validate
type ValidationBuilder ¶
type ValidationBuilder struct {
// contains filtered or unexported fields
}
func NewFieldValidationBuilder ¶
func NewFieldValidationBuilder() *ValidationBuilder
NewFieldValidationBuilder creates a new ValidationBuilder
func (*ValidationBuilder) Build ¶
func (b *ValidationBuilder) Build() *FieldValidation
Build creates the final FieldValidation object using the values defined in the ValidationBuilder
func (*ValidationBuilder) Field ¶
func (b *ValidationBuilder) Field(field string) *ValidationBuilder
Field sets the field of the ValidationBuilder
func (*ValidationBuilder) Message ¶
func (b *ValidationBuilder) Message(message string) *ValidationBuilder
Message sets the message of the ValidationBuilder
Source Files ¶
Click to show internal directories.
Click to hide internal directories.