Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnsupportedType is returned when the type of a field is not supported by the validator. ErrUnsupportedType = errors.New("unsupported type") )
Functions ¶
Types ¶
type ConvertType ¶
type ConvertType string
const ( Int64 ConvertType = "int64" Uint64 ConvertType = "uint64" Float64 ConvertType = "float64" )
type FieldValidation ¶
type FieldValidation struct { Tag string // The tag name used in struct fields for validation. Validate func(fl validator.FieldLevel) bool // The actual field validation function. }
FieldValidation holds the information required for field-level validation.
func (FieldValidation) Register ¶
func (fv FieldValidation) Register(validate *validator.Validate) error
Register adds the field validation function to the provided validator instance.
type StructValidation ¶
type StructValidation struct { Struct interface{} // The struct type that the validation will apply to. Validate func(sl validator.StructLevel) // The actual struct validation function. }
StructValidation holds the information required for struct-level validation.
func (StructValidation) Register ¶
func (sv StructValidation) Register(validate *validator.Validate) error
Register adds the struct validation function to the provided validator instance.
type Validation ¶
type Validation struct {
// contains filtered or unexported fields
}
type Validator ¶
type Validator interface {
Register(validate *validator.Validate) error
}
Validator is an interface that wraps the Register method, providing a standardized way to register different types of validations.
func GetValidations ¶
GetValidations returns a slice of Validator with all custom validators defined for Pulumi config.
Click to show internal directories.
Click to hide internal directories.