Documentation ¶
Index ¶
- Variables
- type FieldParsedValidations
- type FlattenedParsedValidations
- func (f *FlattenedParsedValidations) AddFieldParsedValidations(fieldName string, fieldParsedValidations *FieldParsedValidations) error
- func (f *FlattenedParsedValidations) AddNestedStructParsedValidations(fieldName string, structParsedValidations *StructParsedValidations) error
- func (f *FlattenedParsedValidations) AddRootStructParsedValidations(structParsedValidations *StructParsedValidations) error
- func (f *FlattenedParsedValidations) GetFields() *map[string]interface{}
- type Logger
- type Parser
- type StructParsedValidations
- func (s *StructParsedValidations) AddFieldParsedValidations(fieldName string, fieldParsedValidations *FieldParsedValidations)
- func (s *StructParsedValidations) AddNestedStructParsedValidations(fieldName string, nestedStructParsedValidations *StructParsedValidations)
- func (s *StructParsedValidations) GetFieldParsedValidations(fieldName string) *FieldParsedValidations
- func (s *StructParsedValidations) GetFieldsParsedValidations() *map[string]*FieldParsedValidations
- func (s *StructParsedValidations) GetNestedStructParsedValidations(nestedStruct string) *StructParsedValidations
- func (s *StructParsedValidations) GetStructTypeName() string
Constants ¶
This section is empty.
Variables ¶
var ( ErrNilParsedValidations = errors.New("parsed validations is nil") ErrNilFieldNameAlreadyParsed = "field name already parsed: %s" ErrFlattenedParsedValidationsAlreadyExists = errors.New("flattened parsed validations already exists") )
Functions ¶
This section is empty.
Types ¶
type FieldParsedValidations ¶ added in v0.5.0
type FieldParsedValidations struct {
// contains filtered or unexported fields
}
FieldParsedValidations is the struct for the field JSON parsed validations
func NewFieldParsedValidations ¶ added in v0.5.0
func NewFieldParsedValidations() *FieldParsedValidations
NewFieldParsedValidations creates a new FieldParsedValidations struct
func (*FieldParsedValidations) AddError ¶ added in v0.5.0
func (f *FieldParsedValidations) AddError(error string)
AddError adds an error to the field parsed validations
func (*FieldParsedValidations) AddErrors ¶ added in v0.5.0
func (f *FieldParsedValidations) AddErrors(errors *[]error)
AddErrors adds errors to the field parsed validations
func (*FieldParsedValidations) GetErrors ¶ added in v0.5.0
func (f *FieldParsedValidations) GetErrors() *[]string
GetErrors returns the errors from the field parsed validations
type FlattenedParsedValidations ¶ added in v0.5.0
type FlattenedParsedValidations struct {
// contains filtered or unexported fields
}
FlattenedParsedValidations is the struct for the flattened JSON parsed validations
func NewFlattenedParsedValidations ¶ added in v0.5.0
func NewFlattenedParsedValidations() *FlattenedParsedValidations
NewFlattenedParsedValidations creates a new FlattenedParsedValidations struct
func (*FlattenedParsedValidations) AddFieldParsedValidations ¶ added in v0.5.0
func (f *FlattenedParsedValidations) AddFieldParsedValidations( fieldName string, fieldParsedValidations *FieldParsedValidations, ) error
AddFieldParsedValidations adds a field parsed validations to the flattened JSON parsed validations
func (*FlattenedParsedValidations) AddNestedStructParsedValidations ¶ added in v0.5.0
func (f *FlattenedParsedValidations) AddNestedStructParsedValidations( fieldName string, structParsedValidations *StructParsedValidations, ) error
AddNestedStructParsedValidations adds a nested struct parsed validations to the flattened JSON parsed validations
func (*FlattenedParsedValidations) AddRootStructParsedValidations ¶ added in v0.5.0
func (f *FlattenedParsedValidations) AddRootStructParsedValidations( structParsedValidations *StructParsedValidations, ) error
AddRootStructParsedValidations adds the root struct parsed validations to the flattened JSON parsed validations
func (*FlattenedParsedValidations) GetFields ¶ added in v0.5.0
func (f *FlattenedParsedValidations) GetFields() *map[string]interface{}
GetFields returns the fields from the flattened JSON parsed validations
type Logger ¶ added in v0.5.4
type Logger struct {
// contains filtered or unexported fields
}
Logger is the JWT validator logger
func NewLogger ¶ added in v0.5.4
func NewLogger(header string, modeLogger gologgermode.Logger) (*Logger, error)
NewLogger creates a new JWT validator logger
func (*Logger) FieldParsedValidations ¶ added in v0.5.5
func (l *Logger) FieldParsedValidations( structTypeName, fieldName string, fieldValidations *FieldParsedValidations, )
FieldParsedValidations logs the parsed validations
func (*Logger) NestedStructParsedValidations ¶ added in v0.5.10
func (l *Logger) NestedStructParsedValidations( structTypeName, fieldName, nestedStructTypeName string, )
NestedStructParsedValidations logs the parsed validations
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a struct that holds the JSON parser
func (*Parser) GenerateParsedValidations ¶
func (p *Parser) GenerateParsedValidations( rootStructValidations *govalidatormappervalidations.StructValidations, rootStructParsedValidations *StructParsedValidations, ) error
GenerateParsedValidations returns a
func (*Parser) ParseValidations ¶
func (p *Parser) ParseValidations(rootStructValidations *govalidatormappervalidations.StructValidations) ( interface{}, error, )
ParseValidations parses the validations into JSON
type StructParsedValidations ¶ added in v0.5.0
type StructParsedValidations struct {
// contains filtered or unexported fields
}
StructParsedValidations is the struct for the struct JSON parsed validations
func NewNestedStructParsedValidations ¶ added in v0.5.10
func NewNestedStructParsedValidations( fieldName string, structTypeName string, ) *StructParsedValidations
NewNestedStructParsedValidations creates a new nested StructParsedValidations struct
func NewStructParsedValidations ¶ added in v0.5.0
func NewStructParsedValidations(structTypeName string) *StructParsedValidations
NewStructParsedValidations creates a new StructParsedValidations struct
func (*StructParsedValidations) AddFieldParsedValidations ¶ added in v0.5.0
func (s *StructParsedValidations) AddFieldParsedValidations( fieldName string, fieldParsedValidations *FieldParsedValidations, )
AddFieldParsedValidations adds a field parsed validations to the struct parsed validations
func (*StructParsedValidations) AddNestedStructParsedValidations ¶ added in v0.5.0
func (s *StructParsedValidations) AddNestedStructParsedValidations( fieldName string, nestedStructParsedValidations *StructParsedValidations, )
AddNestedStructParsedValidations adds a nested struct parsed validations to the struct parsed validations
func (*StructParsedValidations) GetFieldParsedValidations ¶ added in v0.5.0
func (s *StructParsedValidations) GetFieldParsedValidations(fieldName string) *FieldParsedValidations
GetFieldParsedValidations returns the field parsed validations from the struct parsed validations
func (*StructParsedValidations) GetFieldsParsedValidations ¶ added in v0.5.0
func (s *StructParsedValidations) GetFieldsParsedValidations() *map[string]*FieldParsedValidations
GetFieldsParsedValidations returns the fields parsed validations from the struct parsed validations
func (*StructParsedValidations) GetNestedStructParsedValidations ¶ added in v0.5.0
func (s *StructParsedValidations) GetNestedStructParsedValidations(nestedStruct string) *StructParsedValidations
GetNestedStructParsedValidations returns the nested struct parsed validations from the struct parsed validations
func (*StructParsedValidations) GetStructTypeName ¶ added in v0.5.10
func (s *StructParsedValidations) GetStructTypeName() string
GetStructTypeName returns the struct type name from the struct parsed validations