validate

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidWindowsPathRegExp = regexp.MustCompile("[<>|:$@\"/%+*?]")

InvalidWindowsPathRegExp is a regex helper.

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}$")

UUIDRegExp is a regex helper.

Functions

func NoEmptyStrings

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

NoEmptyStrings validates that the string is not just whitespace characters (equal to [\r\n\t\f\v ])

func Path

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

Path validates that the string does not contain characters (equal to [<>|:$@\"/%+*?])

func UUID

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

UUID parses a UUID, returning warnings and errors.

func UUIDOrEmpty

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

UUIDOrEmpty parses a UUID, returning nil for warnings if i is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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