Documentation
¶
Overview ¶
Package validation provides common validation utilities for configuration parameters across the goflow library.
This package offers reusable validation functions that help ensure consistent error messages and reduce boilerplate code in constructors and configuration parsers.
Package validation provides common validation utilities for the goflow library.
Index ¶
- func ValidateNonNegative(module, field string, value float64) error
- func ValidateNotEmpty(module, field string, value string) error
- func ValidateNotNil(module, field string, value interface{}) error
- func ValidatePositive(module, field string, value int) error
- func ValidatePositiveFloat(module, field string, value float64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateNonNegative ¶
ValidateNonNegative validates that a numeric value is non-negative (>= 0). Returns a ValidationError if the value is negative.
func ValidateNotEmpty ¶
ValidateNotEmpty validates that a string value is not empty. Returns a ValidationError if the string is empty.
func ValidateNotNil ¶
ValidateNotNil validates that an interface value is not nil. Returns a ValidationError if the value is nil.
func ValidatePositive ¶
ValidatePositive validates that an integer value is positive (> 0). Returns a ValidationError if the value is not positive.
func ValidatePositiveFloat ¶
ValidatePositiveFloat validates that a float64 value is positive (> 0). Returns a ValidationError if the value is not positive.
Types ¶
This section is empty.