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 ¶
func CloneStruct ¶ added in v0.2.0
func CloneStruct(src interface{}) interface{}
CloneStruct uses reflection to create a new instance of the same type and copy each exported field's value from src to the new instance.
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.
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.
type Validation ¶
type Validation struct {
// contains filtered or unexported fields
}
type Validator ¶
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.