validation

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package validation provides data validation utilities for the application. It includes struct validation, custom error messages, and validation rules.

Index

Constants

This section is empty.

Variables

View Source
var CustomErrorMessages = map[string]string{
	"required": "The field {{.Field}} is required",
	"email":    "The field {{.Field}} must be a valid email",
	"min":      "The field {{.Field}} must be at least {{.Param}} characters long",
	"max":      "The field {{.Field}} must be at most {{.Param}} characters long",
}

CustomErrorMessages contains custom error messages for validation

Functions

This section is empty.

Types

type ValidationError

type ValidationError struct {
	Field   string `json:"field"`
	Message string `json:"message"`
}

func ValidateStruct

func ValidateStruct(s any) []ValidationError

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL