struct
CUE v0.18.0
Package struct defines utilities for struct types.
Functions
MaxFields validator
validator form
cue
func(n: int) -> validator({...})call form
cue
func(object: {...}, n: int) -> boolMaxFields validates the maximum number of fields that are part of a struct. It can only be used as a validator, for instance `MaxFields(3)`.
Only fields that are part of the data model count. This excludes hidden fields, optional fields, and definitions.
MinFields validator
validator form
cue
func(n: int) -> validator({...})call form
cue
func(object: {...}, n: int) -> boolMinFields validates the minimum number of fields that are part of a struct. It can only be used as a validator, for instance `MinFields(3)`.
Only fields that are part of the data model count. This excludes hidden fields, optional fields, and definitions.