validation

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrBuildFieldMap

func GetOrBuildFieldMap(t reflect.Type) map[string]string

GetOrBuildFieldMap returns a cached field map or builds and caches it if not present

func ValidateStruct

func ValidateStruct(s interface{}) map[string]FieldErrorDetail

ValidateStruct validates a struct and returns a map of field errors

Types

type FieldErrorDetail

type FieldErrorDetail struct {
	Validator string `json:"validator"`
	Message   string `json:"message"`
}

FieldErrorDetail represents the tag and message for a field error

Jump to

Keyboard shortcuts

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