Versions in this module Expand all Collapse all v1 v1.1.15 Jul 15, 2025 Changes in this version + type FieldConstraint struct + Required bool + Validator Validator v1.1.14 Jul 14, 2025 Changes in this version + func Convert[T any](value any) (T, error) v1.1.13 Jul 11, 2025 Changes in this version type TypeConstraint + StrictMode bool + func NewTypeConstraintWithMode(t reflect.Type, strict bool) *TypeConstraint v1.1.12 Jul 11, 2025 Changes in this version type CompositeValidator + func (cv *CompositeValidator) Add(validators ...Validator) + type StructConstraint struct + Fields map[string]Validator + func NewStructConstraint(fields map[string]Validator) *StructConstraint + func (c *StructConstraint) Validate(value interface{}) error v1.1.11 Jul 10, 2025 Changes in this version + func Validate(value interface{}, validators ...Validator) error + type ArrayConstraint struct + Item Validator + func (v *ArrayConstraint) Validate(value interface{}) error + type CompositeValidator struct + func NewCompositeValidator(validators ...Validator) *CompositeValidator + func (cv *CompositeValidator) Validate(value interface{}) error + type ConditionalValidator struct + func NewConditionalValidator(condition func(interface{}) bool, validator Validator, desc string) *ConditionalValidator + func (v *ConditionalValidator) Validate(value interface{}) error + type EnumConstraint struct + Allowed map[T]struct{} + func NewEnumConstraint[T comparable](values ...T) *EnumConstraint[T] + func (c *EnumConstraint[T]) Validate(value interface{}) error + type FuncValidator struct + func NewFuncValidator(fn func(interface{}) error, desc string) *FuncValidator + func (v *FuncValidator) Validate(value interface{}) error + type LengthConstraint struct + Max *int + Min *int + func (c *LengthConstraint) Validate(value interface{}) error + type PatternConstraint struct + Pattern string + func NewPatternConstraint(pattern string) *PatternConstraint + func (c *PatternConstraint) Validate(value interface{}) error + type RangeConstraint struct + Max *T + Min *T + func (c *RangeConstraint[T]) Validate(value interface{}) error + type RequiredConstraint struct + func (c *RequiredConstraint) Validate(value interface{}) error + type TimeConstraint struct + Format *string + Max *time.Time + Min *time.Time + func (v *TimeConstraint) Validate(value interface{}) error + type TypeConstraint struct + ExpectedType reflect.Type + func NewTypeConstraint(t reflect.Type) *TypeConstraint + func (c *TypeConstraint) Validate(value interface{}) error + type Validator interface + Validate func(value interface{}) error