Documentation
¶
Index ¶
Constants ¶
View Source
const (
// HardwareMappingDeviceIDValidatorErrMessage is the error message when the validation fails.
HardwareMappingDeviceIDValidatorErrMessage = `value must be a valid hardware mapping device ID, e.g. "8086:5916"`
)
Variables ¶
This section is empty.
Functions ¶
func HardwareMappingDeviceIDValidator ¶ added in v0.54.0
HardwareMappingDeviceIDValidator validates a hardware mapping device ID.
func KeyboardLayoutValidator ¶
KeyboardLayoutValidator returns a new validator for keyboard layouts.
func LanguageValidator ¶
LanguageValidator returns a new validator for language codes.
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.
Click to show internal directories.
Click to hide internal directories.