Documentation
¶
Index ¶
- Variables
- func CreateCollector(genType reflect.Type) (func([]string) interface{}, error)
- func ValidateAndSetNumber(field reflect.StructField, structValue reflect.Value, value string) error
- func ValidateAndSetString(field reflect.StructField, structValue reflect.Value, value string) error
- func ValidateNumber(field reflect.StructField, value string) error
- func ValidateString(field reflect.StructField, value string) error
- type CollectionField
- type Script
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CreateCollector ¶
Create a function that can take a struct
func ValidateAndSetNumber ¶
Validate and set a number in a struct field
func ValidateAndSetString ¶
Validate and set a string in a struct field
func ValidateNumber ¶
func ValidateNumber(field reflect.StructField, value string) error
func ValidateString ¶
func ValidateString(field reflect.StructField, value string) error
Validate a string based on the struct tag
Types ¶
type CollectionField ¶
func CreateNumberField ¶
func CreateNumberField(field reflect.StructField, baseField *huh.Input) CollectionField
func CreateStringField ¶
func CreateStringField(field reflect.StructField, baseField *huh.Input) CollectionField
type Script ¶
type Script struct {
Name string
Description string
Collector func([]string) interface{}
Handler func(*mrunner.Runner, interface{}) error
}
func CreateScript ¶
f must be of type func(*mrunner.Runner, T, ...) (..., error).
You can have any return types for f and the second parameter, T, can be a struct that will be dynamically generated based on CLI arguments or a CLI form. Otherwise it will be ignored. Read more about it in the documentation.
Click to show internal directories.
Click to hide internal directories.