validators

package
v0.7.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONSchemaValidator

func JSONSchemaValidator() validator.String

JSONSchemaValidator returns a validator which ensures that a string attribute is a valid JSON and doesn't exceed the maximum allowed nesting depth

func RegexMatches

func RegexMatches(regexp *regexp.Regexp, message string) validator.String

RegexMatches returns a validator.String that ensures any configured value matches the provided regular expression pattern. Null and unknown values are skipped. An optional message can be provided to customize the error output.

func StringListAllowedValues

func StringListAllowedValues(values ...string) validator.List

StringListAllowedValues returns a validator that ensures each string in a list matches one of the allowed values.

Types

This section is empty.

Directories

Path Synopsis
graph_beta

Jump to

Keyboard shortcuts

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