validation

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule func(value any, params ...string) error

Rule represents a validation rule

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator provides validation functionality

func New

func New() *Validator

New creates a new validator

func (*Validator) RegisterRule

func (v *Validator) RegisterRule(name string, rule Rule)

RegisterRule registers a new validation rule

func (*Validator) ValidateField

func (v *Validator) ValidateField(field any, tag string) error

ValidateField validates a field

func (*Validator) ValidateStruct

func (v *Validator) ValidateStruct(s any) error

ValidateStruct validates a struct

Jump to

Keyboard shortcuts

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