validate

package
v2.96.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UUIDRegExp = regexp.MustCompile("^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[8|9|aA|bB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$")

uuid regex helper

Functions

func AzureTimeZoneString

func AzureTimeZoneString() func(interface{}, string) ([]string, []error)

func Base64EncodedString

func Base64EncodedString(i interface{}, k string) ([]string, []error)

Base64EncodedString validates that the string is base64 encoded

func CIDR

func CIDR(i interface{}, k string) (warnings []string, errors []error)

CIDR is a SchemaValidateFunc which tests if the provided value is a valid IPv4 CIDR

func FloatInSlice

func FloatInSlice(valid []float64) func(interface{}, string) ([]string, []error)

FloatInSlice returns a SchemaValidateFunc which tests if the provided value is of type float64 and matches the value of an element in the valid slice

func GoogleClientID

func GoogleClientID(v interface{}, k string) (warnings []string, errors []error)

func IPv4Address

func IPv4Address(i interface{}, k string) (warnings []string, errors []error)

func IPv4AddressOrEmpty

func IPv4AddressOrEmpty(i interface{}, k string) (warnings []string, errors []error)

func ISO8601DateTime

func ISO8601DateTime(i interface{}, k string) (warnings []string, errors []error)

func ISO8601Duration

func ISO8601Duration(i interface{}, k string) (warnings []string, errors []error)

func ISO8601DurationBetween

func ISO8601DurationBetween(min string, max string) func(i interface{}, k string) (warnings []string, errors []error)

func LowerCasedString

func LowerCasedString(i interface{}, k string) ([]string, []error)

LowerCasedString validates that the string is lower-cased

func PortNumber

func PortNumber(i interface{}, k string) (warnings []string, errors []error)

func PortNumberOrZero

func PortNumberOrZero(i interface{}, k string) (warnings []string, errors []error)

func PortOrPortRangeWithin

func PortOrPortRangeWithin(min int, max int) func(interface{}, string) ([]string, []error)

func RegExHelper

func RegExHelper(i interface{}, k, r string) (match bool, errors []error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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