apivalidation

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSupportedIPFamily

func IsSupportedIPFamily(ipFamily corev1.IPFamily) bool

func ValidateEnum

func ValidateEnum[E comparable](allowed sets.Set[E], value E, fldPath *field.Path, requiredDetail string) field.ErrorList

func ValidateFieldAllowList

func ValidateFieldAllowList(value interface{}, allowedFields sets.Set[string], errorText string, fldPath *field.Path) field.ErrorList

ValidateFieldAllowList checks that only allowed fields are set. The value must be a struct (not a pointer to a struct!).

func ValidateIPFamilies

func ValidateIPFamilies(ipFamilies []corev1.IPFamily, fldPath *field.Path) field.ErrorList

func ValidateIPFamily

func ValidateIPFamily(ipFamily corev1.IPFamily, fldPath *field.Path) field.ErrorList

func ValidateImmutableField

func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path) field.ErrorList

func ValidateImmutableFieldWithDiff

func ValidateImmutableFieldWithDiff(newVal, oldVal interface{}, fldPath *field.Path) field.ErrorList

func ValidateNonNegativeQuantity

func ValidateNonNegativeQuantity(value resource.Quantity, fldPath *field.Path) field.ErrorList

func ValidatePositiveQuantity

func ValidatePositiveQuantity(value resource.Quantity, fldPath *field.Path) field.ErrorList

func ValidatePowerOfTwo

func ValidatePowerOfTwo(value int64, fldPath *field.Path) field.ErrorList

func ValidateProtocol

func ValidateProtocol(protocol corev1.Protocol, fldPath *field.Path) field.ErrorList

func ValidateSetOnceField

func ValidateSetOnceField(newVal, oldVal interface{}, fldPath *field.Path) field.ErrorList

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL