Documentation ¶
Overview ¶
Package v3 implements common field and structure validation that is used to validate the API structures supplied on the client interface, and is also used internally to validate the information stored in the backend datastore.
Index ¶
- Variables
- func RegexValidator(desc string, rx *regexp.Regexp) func(fl validator.FieldLevel) bool
- func Validate(current interface{}) error
- func ValidateCIDRv4(cidr string) error
- func ValidateCIDRv6(cidr string) error
- func ValidateIPv4Network(addr string) error
- func ValidateIPv6Network(addr string) error
- func ValidateMAC(mac string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( IPv4PortFormat = regexp.MustCompile(`^(\d+).(\d+).(\d+).(\d+):(\d+)$`) IPv6PortFormat = regexp.MustCompile(`^\[[0-9a-fA-F:.]+\]:(\d+)$`) SourceAddressRegex = regexp.MustCompile("^(UseNodeIP|None)$") )
Functions ¶
func RegexValidator ¶
func Validate ¶
func Validate(current interface{}) error
Validate is used to validate the supplied structure according to the registered field and structure validators.
func ValidateCIDRv4 ¶
func ValidateCIDRv6 ¶
func ValidateIPv4Network ¶
func ValidateIPv6Network ¶
func ValidateMAC ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.