Documentation
¶
Overview ¶
Package validate implements the value checks Apple's device-management schema declares on payload keys: closed value sets (rangelist), numeric bounds (range), regular-expression formats, array cardinality (repetition) and string subtypes (<url>, <hostname>, <email>).
Generated Validate() methods call these helpers; they are exported so hand-written code can reuse the same semantics.
Index ¶
- func Email(field, v string) error
- func FloatRange(field string, v float64, min, max *float64) error
- func Format(field, v, pattern string) error
- func Hostname(field, v string) error
- func InList[T comparable](field string, v T, allowed []T) error
- func Indexed(field string, i int, err error) error
- func IntRange(field string, v int64, min, max *int64) error
- func Nested(field string, err error) error
- func Repetition(field string, n, min, max int) error
- func Required(field string) error
- func URL(field, v string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FloatRange ¶
FloatRange checks real-number bounds from the spec's range block.
func Format ¶
Format checks v against the spec's regular-expression format. Patterns are anchored to the full value, matching the spec's intent.
func InList ¶
func InList[T comparable](field string, v T, allowed []T) error
InList checks membership of v in the spec's rangelist.
func Repetition ¶
Repetition checks array cardinality from the spec's repetition block.
Types ¶
This section is empty.