validation

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateAndConvert

func ValidateAndConvert[T Validator, U any](
	item T,
	converter func(T) U,
	itemType string,
) result.Result[U]

ValidateAndConvert provides a generic validation and conversion pattern Useful when you need to validate and then convert to a different type.

func ValidateAndWrap

func ValidateAndWrap[T Validator](item T, itemType string) result.Result[T]

ValidateAndWrap provides a generic validation wrapper that returns a Result[T] This eliminates duplicate validation patterns across the codebase.

func ValidateWithCustomError

func ValidateWithCustomError[T Validator](item T, errorMsg string) result.Result[T]

ValidateWithCustomError provides a generic validation wrapper with custom error message.

Types

type Validator

type Validator interface {
	Validate() error
}

Validator interface for types that can be validated.

Jump to

Keyboard shortcuts

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