Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Validator ¶
type Validator struct {
Name string
}
func NewValidator ¶
NewValidator creates and returns a new instance of Validator with the specified name.
Parameters:
- name: The name of the prompt being validated.
Returns:
- *Validator: A pointer to the newly created Validator instance.
func (*Validator) Panic ¶
Panic triggers a panic with a formatted message that includes the validator's name and the provided cause.
Parameters:
- cause: The reason for the panic.
func (*Validator) PanicMissingParam ¶
PanicMissingParam triggers a panic indicating that a specific parameter is missing. The panic message is formatted to include the validator's name and the missing parameter.
Parameters:
- param: The name of the missing parameter.
func (*Validator) ValidateOptions ¶
ValidateOptions checks if at least one option is provided. If no options are provided, it triggers a panic indicating that the "Options" parameter is missing.
Parameters:
- length: The number of options provided.
func (*Validator) ValidateRender ¶
ValidateRender checks if a render function is provided. If the render function is nil, it triggers a panic indicating that the "Render" parameter is missing.
Parameters:
- render: The render function to validate.