validator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormDecode

func FormDecode(object any, values map[string][]string) error

FormDecode decodes the values from the map[string][]string into the provided object using the formDecoder instance.

Parameters: - object: the object to be decoded - values: the map containing the values to be decoded Return type: error

func Initialize

func Initialize()

Initialize initializes the Validator instance with playValidator and formDecoder, then registers custom types.

No parameters. No return values.

func RegisterCustomValidation

func RegisterCustomValidation(tag string, fn playValidator.Func)

RegisterCustomValidation registers a custom validation function with the provided tag.

Parameters: - tag: the tag to be registered - fn: the function to be registered No return values.

func Struct

func Struct(object any) error

Struct performs validation on the provided object using the validator instance.

Parameter: - object: the object to be validated Return type: error

Types

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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