Documentation
¶
Index ¶
- Variables
- func ConfigByField[T any](configReader io.Reader, fieldname string) (T, error)
- func NewFailedRuleError(rule string, id string) error
- func ValidateFunc[S ~[]E, E any](target S, check func(E) error) error
- type Validator
- func (v Validator[ObjectT, ConfigT]) ReadConfigAndValidate(objects []ObjectT, configReader io.Reader, field string) error
- func (v Validator[ObjectT, ConfigT]) Validate(objects []ObjectT, config ConfigT) error
- func (v Validator[ObjectT, ConfigT]) WithAllowRules(rules ...func(ObjectT, ConfigT) bool) Validator[ObjectT, ConfigT]
- func (v Validator[ObjectT, ConfigT]) WithValidationRules(rules ...func([]ObjectT, ConfigT) error) Validator[ObjectT, ConfigT]
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConfig = errors.New("cannot validate, invalid configuration")
View Source
var ErrFailedRule = errors.New("Failed Rule")
Functions ¶
func NewFailedRuleError ¶
func ValidateFunc ¶
Types ¶
type Validator ¶
func NewValidator ¶
func (Validator[ObjectT, ConfigT]) ReadConfigAndValidate ¶
func (Validator[ObjectT, ConfigT]) WithAllowRules ¶
func (Validator[ObjectT, ConfigT]) WithValidationRules ¶
Click to show internal directories.
Click to hide internal directories.