Documentation
¶
Overview ¶
Package settings validates declarative inspector fields without losing extensions
Index ¶
- func Bool(s map[string]any, key string) bool
- func Clone(value any) any
- func Merge(global, action map[string]any) map[string]any
- func Number(s map[string]any, key string, fallback float64) float64
- func String(s map[string]any, key, fallback string) string
- func Validate(fields []Field, input map[string]any) (map[string]any, error)
- type Field
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Field ¶
type Field struct {
PathPicker string `json:"path_picker,omitempty"`
DefaultPresent bool `json:"-"`
Key string `json:"key"`
Label string `json:"label"`
Type string `json:"type"`
Default any `json:"default,omitempty"`
Options []string `json:"options,omitempty"`
OptionLabels map[string]string `json:"option_labels,omitempty"`
Min *float64 `json:"min,omitempty"`
Max *float64 `json:"max,omitempty"`
Required bool `json:"required,omitempty"`
// Sensitive masks string fields in inspectors; values remain ordinary strings
Sensitive bool `json:"sensitive,omitempty"`
}
func (*Field) UnmarshalJSON ¶
UnmarshalJSON distinguishes an absent default from an explicit null default
Click to show internal directories.
Click to hide internal directories.