package structs
import "cuelang.org/go/pkg/struct"
Package struct defines utilities for struct types.
Index ¶
- func MaxFields(object pkg.Struct, n int) (bool, error)
- func MinFields(object pkg.Struct, n int) (bool, error)
Functions ¶
func MaxFields ¶
MaxFields 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.
func MinFields ¶
MinFields 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.
Source Files ¶
pkg.go struct.go
- Version
- v0.12.0 (latest)
- Published
- Jan 30, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 8 hours ago –
Tools for package owners.