Discover Packages
github.com/hexdigest/genval
examples
overriding
package
Version:
v1.5.1
Opens a new window with list of versions in this module.
Published: Dec 29, 2017
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Age1 struct {
Value int `validate:"min=3,max=64"`
}
type Age2 struct {
Value int `validate:"min=3,max=64"`
}
type Age3 struct {
Value int `validate:"min=3,max=64"`
}
type Age4 struct {
Value int `validate:"min=3,max=64"`
}
type Age5 struct {
Value int `validate:"min=3,max=64"`
}
type Request1 struct {
Age Age1
Some int `validate:"min=3,max=64"`
}
public validator for Request1 will not be generated because of overriding,
validator for Age1 will not changed.
type Request2 struct {
Age Age2 `validate:"func=.ValidateMin10"`
Some int `validate:"min=3,max=64"`
}
public validator for Request2 will be generated and will use ValidateMin10 method for Age2,
validator for Age2 will not changed.
Validate validates Request2
type Request3 struct {
Age Age3 `validate:"func=validateMin10"`
Some int `validate:"min=3,max=64"`
}
public validator for Request3 will be generated and will use validateMin10 func for Age3,
validator for Age3 will not changed.
Validate validates Request3
type Request4 struct {
Age Age4 `validate:"func=.ValidateMin10;validateMax128"`
Some int `validate:"min=3,max=64"`
}
public validator for Request4 will be generated and will use ValidateMin10 method and validateMax128 func for Age4,
validator for Age4 will not changed.
Validate validates Request4
type Request5 struct {
Age Age5
Some int `validate:"min=3,max=64"`
}
Just additional validation of request added
Validate validates Request5
Source Files
¶
Click to show internal directories.
Click to hide internal directories.