validation

package
v0.115.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package validation provides struct-tag validation helpers and custom validator registration for internal config types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterValidationFunc

func RegisterValidationFunc(tag string, fn Func) error

RegisterValidationFunc registers a custom validation tag for use in struct field tags.

func Validate

func Validate(v any) error

Validate applies validator rules and this package's custom tag handlers.

Types

type Func

type Func func(v any, param string) error

Func adapts custom field validation to the tag+parameter shape used in struct tags.

type TextError

type TextError struct {
	Err error
}

func (TextError) Error

func (e TextError) Error() string

Error returns the wrapped error text.

func (TextError) Unwrap

func (e TextError) Unwrap() error

Unwrap exposes the wrapped error for errors.Is and errors.As.

Jump to

Keyboard shortcuts

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