validators

package
v12.130.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Overview

Package validators provides basic KNF validators

Index

Constants

This section is empty.

Variables

View Source
var (
	// Empty returns error if property is not set
	Set = validatorSet

	// SetToAny returns error if property doesn't contain any value from given slice
	SetToAny = validatorSetToAny

	// SetToAnyIgnoreCase returns error if property doesn't contain value from given
	// slice in any letter case
	SetToAnyIgnoreCase = validatorSetToAnyIgnoreCase

	// Less returns an error if property is less than given number
	Less = validatorLess

	// Greater returns error if property is greater than given number
	Greater = validatorGreater

	// Equals returns error if property is equal to given string
	Equals = validatorEquals

	// LenLess returns an error if the length of the property value is less than
	// given number
	LenLess = validatorLenLess

	// LenGreater returns an error if the length of the property value is greater than
	// given number
	LenGreater = validatorLenGreater

	// LenNotEquals an error if the length of the property value is not equal to the
	// given number
	LenNotEquals = validatorLenNotEquals

	// NotPrefix returns error if property doesn't have given prefix
	NotPrefix = validatorNotPrefix

	// NotPrefix returns error if property doesn't have given suffix
	NotSuffix = validatorNotSuffix

	// TypeBool returns error if property contains non-boolean value
	TypeBool = validatorTypeBool

	// TypeNum returns error if property contains non-numeric (int/uint) value
	TypeNum = validatorTypeNum

	// TypeNum returns error if property contains non-float value
	TypeFloat = validatorTypeFloat
)
View Source
var (
	// Empty returns error if property is empty
	//
	// Deprecated: Use validator Set instead
	Empty = validatorSet

	// NotContains returns error if property doesn't contains value from given slice
	//
	// Deprecated: Use validator SetToAny instead
	NotContains = validatorSetToAny

	// NotLen returns error if property has wrong size
	//
	// Deprecated: Use validator LenNotEquals instead
	NotLen = validatorNotLen
)

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package fs provides KNF validators for checking file-system items
Package fs provides KNF validators for checking file-system items
Package network provides KNF validators for checking items related to network
Package network provides KNF validators for checking items related to network
Package regexp provides KNF validators with regular expressions
Package regexp provides KNF validators with regular expressions
Package system provides KNF validators for checking system items (user, groups, network interfaces)
Package system provides KNF validators for checking system items (user, groups, network interfaces)

Jump to

Keyboard shortcuts

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