Versions in this module Expand all Collapse all v0 v0.3.0 Jul 22, 2026 v0.2.0 Jul 13, 2026 Changes in this version + func ValidateStruct(structPtr any, fields ...FieldRules) error + type Errors []ValidationError + func (e Errors) Error() string + func (e Errors) MarshalJSON() ([]byte, error) + func (e Errors) Unwrap() []error + type FieldRules interface + func Field[T any](fieldPtr *T, rules ...Rule[T]) FieldRules + type Rule interface + Validate func(value T) error + func AllowedExtensions(exts ...string) Rule[*multipart.FileHeader] + func AllowedMimeTypes(types ...string) Rule[*multipart.FileHeader] + func Between[T cmp.Ordered](min, max T) Rule[T] + func By[T any](fn func(T) error) Rule[T] + func DateAfter(threshold time.Time) Rule[time.Time] + func DateBefore(threshold time.Time) Rule[time.Time] + func Each[T any](rules ...Rule[T]) Rule[[]T] + func Email() Rule[string] + func In[T comparable](values ...T) Rule[T] + func Length(min, max int) Rule[string] + func MaxFileSize(maxBytes int64) Rule[*multipart.FileHeader] + func Max[T cmp.Ordered](threshold T) Rule[T] + func Min[T cmp.Ordered](threshold T) Rule[T] + func NilSafe[T any](rules ...Rule[T]) Rule[*T] + func NotEmptyMap[K comparable, V any]() Rule[map[K]V] + func NotEmptySlice[E any]() Rule[[]E] + func NotNil[T any]() Rule[*T] + func Regex(pattern *regexp.Regexp) Rule[string] + func Required[T comparable]() Rule[T] + func URL() Rule[string] + func UUID() Rule[string] + func When[T any](condition bool, rules ...Rule[T]) Rule[T] + type Validatable interface + Validate func() error + type ValidationError struct + Code string + Field string + Message string + Params map[string]any + func (e *ValidationError) Error() string