Documentation
¶
Overview ¶
Package validator provides functionality for validating and sanitizing data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBase64URL ¶ added in v2.2.0
IsBase64URL validates that a string is valid base64url format with minimum length for encrypted content. checks: valid base64url characters (A-Za-z0-9-_), no padding (=), minimum 39 chars (12-byte IV + 1-byte type + 16-byte tag = 29 bytes).
func MaxDuration ¶
MaxDuration validates if a duration is within the maximum allowed duration.
Types ¶
type Validator ¶
Validator is a struct that contains field errors and a non-field errors.
func (*Validator) AddFieldError ¶
AddFieldError adds an error message to the FieldErrors map.
func (*Validator) AddNonFieldError ¶
AddNonFieldError adds an error message to the NonFieldErrors slice.
func (*Validator) CheckField ¶
CheckField adds an error message to the FieldErrors map only if a validation check is not passed.