validation

package
v0.0.0-...-798ae07 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// When an IPSpec has an invalid 'type' field.
	ErrInvalidIPType = errors.New("ip type is not set to either 'IPv4' or 'IPv6'")
	// When an IPSpec has an invalid address that can't be parsed.
	ErrInvalidIP = errors.New("ip address is not correctly formatted")
)
View Source
var (
	// When a mac address is invalid.
	ErrInvalidMACAddress = errors.New("invalid mac address")
)

Functions

func ValidateAddress

func ValidateAddress(in *net.Address) []error

Statically Validates an Address object coming into the API and returns a list of errors with the object.

func ValidateAddressList

func ValidateAddressList(in *net.AddressList) []error

Statically Validates an AddressList object coming into the API and returns a list of errors with the object.

func ValidateAddressSpec

func ValidateAddressSpec(in *net.AddressSpec) []error

Statically validates an AddressSpec object coming into the API and returns a list of errors with the object.

func ValidateIPSpec

func ValidateIPSpec(in *net.IPSpec) []error
func ValidateLink(in *net.Link) []error

Statically Validates an Link object coming into the API and returns a list of errors with the object.

func ValidateLinkList(in *net.LinkList) []error

Statically Validates a LinkList object coming into the API and returns a list of errors with the object.

func ValidateLinkSpec

func ValidateLinkSpec(in *net.LinkSpec) []error

Statically Validates an LinkSpec object coming into the API and returns a list of errors with the object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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