Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteMultiplier ¶ added in v1.5.0
ByteMultiplier exposes the normalized multiplier lookup for other packages.
func ParseBytes ¶ added in v1.5.0
ParseBytes parses a string representation of bytes into an int64. It supports both pure numbers and size suffixes (IEC and SI). Examples: "1024", "1KiB", "2.5MB", "1G".
func ParseBytesUint ¶ added in v1.5.0
ParseBytesUint parses a string representation of bytes into a uint64. It supports both pure numbers and size suffixes (IEC and SI). Uses big.Int arithmetic for precision with large values.
Types ¶
type FieldError ¶
type FieldError struct {
Path string // e.g., "Database.Port"
Tag string // e.g., "env", "default"
Value string // the invalid value
Message string
Err error
}
FieldError represents an error that occurred while processing a specific field.
func (*FieldError) Error ¶
func (e *FieldError) Error() string
Error returns the string representation of the FieldError.
func (*FieldError) Unwrap ¶
func (e *FieldError) Unwrap() error
Unwrap returns the underlying error.
type LoadError ¶
type LoadError struct {
Source string // file path or source name
Errors []FieldError
}
LoadError represents an error that occurred during the configuration loading process.
type Setter ¶
type Setter interface {
// SetDefaults sets default values for the struct.
SetDefaults()
}
Setter is an interface for setting default values. Only pointer receivers should implement this interface.
type ValidationError ¶
type ValidationError struct {
Errors []error
}
ValidationError wraps validation errors from the validator package.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error returns the string representation of the ValidationError.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap returns the first error in the list.