validator

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Validator = sync.OnceValue(func() *validator.Validate {
	validator := validator.New()
	validator.RegisterValidation("floatin", floatInValidator)
	validator.RegisterValidation("choicelist", choiceListValidator)
	return validator
})

Validator is a lazily-initialised, package-level singleton of *validator.Validate. It caches struct metadata for efficiency and registers the custom validation tags "floatin" (checks a float field against a whitelist of allowed values) and "choicelist" (checks that every comma-separated token is in an allowed set).

Functions

This section 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