validator

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAndValidate

func LoadAndValidate(filename string) (*model.RoutemapRoot, model.RoutemapSummary, error)

func ValidateLabels

func ValidateLabels(labels []string, mapIdx int, summary *model.RoutemapSummary) error

ValidateLabels validates the set of labels of the route map.

func ValidateNetmaskLen

func ValidateNetmaskLen(ipnet *net.IPNet) error

ValidateNetmaskLen verifies that the mask length does not exceeds the maximum allowed value.

func ValidateNetwork

func ValidateNetwork(network string) (net.IP, *net.IPNet, error)

ValidateNetwork takes an string representing a network from the JSON source file and validates it. Returns the parsed IP and IPNet along with an error instance that can possibly be a multierr instance.

If the network can not be parsed, only the error instance will contain values. The correctness of the network depends on the returned error having a nil value.

func ValidateNetworks

func ValidateNetworks(nets []string, mapIdx int, summary *model.RoutemapSummary) error

func ValidateProperCIDR

func ValidateProperCIDR(ip net.IP, ipnet *net.IPNet) error

ValidateProperCIDR verifies that the IP address corresponds to the network.

func ValidateVersion

func ValidateVersion(version int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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