Documentation ¶
Index ¶
- func HAResourceIDValidator() validator.String
- func HAResourceStateValidator() validator.String
- func HAResourceTypeValidator() validator.String
- func KeyboardLayoutValidator() validator.String
- func LanguageValidator() validator.String
- func NewParseValidator[T any](parseFunction func(string) (T, error), description string) validator.String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HAResourceIDValidator ¶
HAResourceIDValidator returns a new HA resource identifier validator.
func HAResourceStateValidator ¶
HAResourceStateValidator returns a new HA resource state validator.
func HAResourceTypeValidator ¶
HAResourceTypeValidator returns a new HA resource type validator.
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.