v3

package
v0.0.0-...-21cfbab Latest Latest
Warning

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

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

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

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 RegexValidator(desc string, rx *regexp.Regexp) func(fl validator.FieldLevel) bool

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 ValidateCIDRv4(cidr string) error

func ValidateCIDRv6

func ValidateCIDRv6(cidr string) error

func ValidateIPv4Network

func ValidateIPv4Network(addr string) error

func ValidateIPv6Network

func ValidateIPv6Network(addr string) error

func ValidateMAC

func ValidateMAC(mac string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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