package
6.6.0
Repository: https://github.com/lxc/incus.git
Documentation: pkg.go.dev

# Functions

And returns a function that runs one or more validators, all must pass without error.
IsAbsFilePath checks if value is an absolute file path.
IsAny accepts all strings as valid.
IsArchitecture validates whether the value is a valid architecture name.
IsBool validates if string can be understood as a bool.
IsCloudInitUserData checks value is valid cloud-init user data.
IsCompressionAlgorithm validates whether a value is a valid compression algorithm and is available on the system.
IsCron checks that it's a valid cron pattern or alias.
IsDeviceID validates string is four lowercase hex characters suitable as Vendor or Device ID.
IsDeviceName checks name is 1-63 characters long, doesn't start with a full stop and contains only alphanumeric, forward slash, hyphen, colon, underscore and full stop characters.
IsHostname checks the string is valid DNS hostname.
IsInRange checks whether an integer is within a specific range.
IsInt64 validates whether the string can be converted to an int64.
IsInterfaceName validates a real network interface name.
IsListenAddress returns a validator for a listen address.
IsListOf returns a validator for a comma separated list of values.
IsNetwork validates an IP network CIDR string.
IsNetworkAddress validates an IP (v4 or v6) address string.
IsNetworkAddressCIDR validates an IP address string in CIDR format.
IsNetworkAddressCIDRV4 validates an IPv4 address string in CIDR format.
IsNetworkAddressCIDRV6 validates an IPv6 address string in CIDR format.
IsNetworkAddressV4 validates an IPv4 address string.
IsNetworkAddressV6 validates an IPv6 address string.
IsNetworkMAC validates an Ethernet MAC address.
IsNetworkMTU validates MTU number >= 1280 and <= 16384.
IsNetworkName validates a name usable for a network.
IsNetworkPort validates an IP port number >= 0 and <= 65535.
IsNetworkPortRange validates an IP port range in the format "port" or "start-end".
IsNetworkRange validates an IP range in the format "start-end".
IsNetworkRangeV4 validates an IPv4 range in the format "start-end".
IsNetworkRangeV6 validates an IPv6 range in the format "start-end".
IsNetworkV4 validates an IPv4 CIDR string.
IsNetworkV6 validates an IPv6 CIDR string.
IsNetworkVLAN validates a VLAN ID.
IsNotEmpty requires a non-empty string.
IsOneOf checks whether the string is present in the supplied slice of strings.
IsPCIAddress validates whether a value is a PCI address.
IsPriority validates priority number.
IsRequestURL checks value is a valid HTTP/HTTPS request URL.
IsSize checks if string is valid size according to units.ParseByteSizeString.
IsUint32 validates whether the string can be converted to an uint32.
IsUint32Range validates whether the string is a uint32 range in the form "number" or "start-end".
IsUint8 validates whether the string can be converted to an uint8.
IsURLSegmentSafe validates whether value can be used in a URL segment.
IsUUID validates whether a value is a UUID.
IsValidCPUSet checks value is a valid CPU set.
IsYAML checks value is valid YAML.
Optional wraps Required() function to make it return nil if value is empty string.
Or returns a function that runs one or more validators, at least one must pass without error.
ParseNetworkVLANRange parses a VLAN range in the form "number" or "start-end".
Required returns a function that runs one or more validators, all must pass without error.