Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTooLow = errors.NewFrozenError("TOO_LOW", "Value is too low", 400) ErrTooHigh = errors.NewFrozenError("TOO_HIGH", "Value is too high", 400) ErrTooShort = errors.NewFrozenError("TOO_SHORT", "Value is too short", 400) ErrTooLong = errors.NewFrozenError("TOO_LONG", "Value is too long", 400) ErrRequired = errors.NewFrozenError("REQUIRED", "Value is required", 400) ErrFailedEnum = errors.NewFrozenError("FAILED_ENUM", "Invalid value", 400) ErrFailedPattern = errors.NewFrozenError("FAILED_PATTERN", "Value does not match pattern", 400) ErrFailedDefault = errors.NewFrozenError("FAILED_DEFAULT", "Default value can't be set", 500) )
Functions ¶
Types ¶
type StructValidator ¶
Validates T and returns a boolean whether it's valid
func CreateStructValidator ¶
func CreateStructValidator[T any]() (StructValidator[T], error)
Create a validator that can be reused for a specific struct type.
func GetStructValidator ¶ added in v0.25.0
func GetStructValidator[T any]() (StructValidator[T], error)
Click to show internal directories.
Click to hide internal directories.