validators

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParseValidator

func NewParseValidator[T any](parseFunction func(string) (T, error), description string) validator.String

NewParseValidator creates a validator which uses a parsing function to validate a string. The function is expected to return a value of type `T` and an error. If the error is non-nil, the validator will fail. The `description` argument should contain a description of the validator's effect.

Types

This section is empty.

Jump to

Keyboard shortcuts

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