Documentation
¶
Overview ¶
Package handler provides a handler interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
Parse(string) (any, error) // Used to optimize: pre-parse and cache the tag value.
Run(ctx any, rootStructValue, fieldValue reflect.Value, fieldType reflect.StructField, arg any) error
}
Handler is an interface to handle the struct field.
type Runner ¶
type Runner func(ctx any, root reflect.Value, vf reflect.Value, sf reflect.StructField, arg any) error
Runner is the function to handle the struct field.
func FieldRunner ¶ added in v0.3.0
FieldRunner converts a field value function to Runner.
func SimpleRunner ¶
SimpleRunner converts a simple function to Runner.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package setdefault provides a handler to set the default of the struct field.
|
Package setdefault provides a handler to set the default of the struct field. |
|
Package setter provides a handler to set the struct field to a value.
|
Package setter provides a handler to set the struct field to a value. |
|
Package validate provides a handler to validate the struct field.
|
Package validate provides a handler to validate the struct field. |
Click to show internal directories.
Click to hide internal directories.