Documentation
¶
Index ¶
- type ValidationError
- func ARN(field, value string) *ValidationError
- func CIDR(field, value string) *ValidationError
- func InRange(field string, value, min, max int) *ValidationError
- func MaxLength(field, value string, max int) *ValidationError
- func MinLength(field, value string, min int) *ValidationError
- func Name(field, value string) *ValidationError
- func OneOf(field, value string, allowed []string) *ValidationError
- func Pattern(field, value, pattern, description string) *ValidationError
- func Required(field, value string) *ValidationError
- func Validate(checks ...*ValidationError) *ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ValidationError ¶
ValidationError is returned when input fails validation.
func ARN ¶
func ARN(field, value string) *ValidationError
ARN validates an ARN format (arn:partition:service:region:account:resource).
func InRange ¶
func InRange(field string, value, min, max int) *ValidationError
InRange checks an integer is within bounds (inclusive).
func MaxLength ¶
func MaxLength(field, value string, max int) *ValidationError
MaxLength checks maximum string length.
func MinLength ¶
func MinLength(field, value string, min int) *ValidationError
MinLength checks minimum string length.
func Name ¶
func Name(field, value string) *ValidationError
Name validates a typical AWS resource name (alphanumeric, hyphens, underscores, 1-128 chars).
func OneOf ¶
func OneOf(field, value string, allowed []string) *ValidationError
OneOf checks a string is one of the allowed values.
func Pattern ¶
func Pattern(field, value, pattern, description string) *ValidationError
Pattern checks a string matches a regex pattern.
func Required ¶
func Required(field, value string) *ValidationError
Required checks that a string field is non-empty.
func Validate ¶
func Validate(checks ...*ValidationError) *ValidationError
Validate runs multiple checks and returns the first error, or nil.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.