validation

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToInternalErrorList

func ToInternalErrorList(fldPath *field.Path, err error) field.ErrorList

ToInternalErrorList converts an error into an ErrorList with a single InternalError if it is not nil, otherwise returns an empty list.

func ValidateGT

func ValidateGT(value, minimum int64, fldPath *field.Path) field.ErrorList

ValidateGT validates the given value must be greater than the minimum value.

func ValidateGTE

func ValidateGTE(value, minimum int64, fldPath *field.Path) field.ErrorList

ValidateGTE validates the given value must be greater than or equal to the minimum value.

func ValidateImmutableField

func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path, msg string) field.ErrorList

ValidateImmutableField validates the new value and the old value are deeply equal and returns an error with a custom message.

func ValidateLT

func ValidateLT(value, maximum int64, fldPath *field.Path) field.ErrorList

ValidateLT validates the given value must be less than the maximum value.

func ValidateLTE

func ValidateLTE(value, maximum int64, fldPath *field.Path) field.ErrorList

ValidateLTE validates the given value must be less than or equal to the maximum value.

func ValidateMaxLength

func ValidateMaxLength(val string, maxLen int, fldPath *field.Path) field.ErrorList

ValidateMaxLength validates the value to enforce a maximum length.

Types

This section is empty.

Jump to

Keyboard shortcuts

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