gocuelang.org/go/pkg/struct Index | Files

package structs

import "cuelang.org/go/pkg/struct"

Package struct defines utilities for struct types.

Index

Functions

func MaxFields

func MaxFields(object *cue.Struct, n int) (bool, error)

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

func MinFields(object *cue.Struct, n int) *adt.Bottom

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.4.0-beta.2
Published
May 13, 2021
Platform
darwin/amd64
Imports
5 packages
Last checked
41 minutes ago

Tools for package owners.