model

package
v0.28.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SchemaDeclType

func SchemaDeclType(s *schema.Structural, isResourceRoot bool) *apiservercel.DeclType

SchemaDeclType converts the structural schema to a CEL declaration, or returns nil if the structural schema should not be exposed in CEL expressions. Set isResourceRoot to true for the root of a custom resource or embedded resource.

Schemas with XPreserveUnknownFields not exposed unless they are objects. Array and "maps" schemas are not exposed if their items or additionalProperties schemas are not exposed. Object Properties are not exposed if their schema is not exposed.

The CEL declaration for objects with XPreserveUnknownFields does not expose unknown fields.

func WithTypeAndObjectMeta

func WithTypeAndObjectMeta(s *schema.Structural) *schema.Structural

WithTypeAndObjectMeta ensures the kind, apiVersion and metadata.name and metadata.generateName properties are specified, making a shallow copy of the provided schema if needed.

Types

type Structural added in v0.27.0

type Structural struct {
	Structural *schema.Structural
}

func (*Structural) AdditionalProperties added in v0.27.0

func (s *Structural) AdditionalProperties() common.SchemaOrBool

func (*Structural) Default added in v0.27.0

func (s *Structural) Default() any

func (*Structural) Enum added in v0.27.0

func (s *Structural) Enum() []any

func (*Structural) Format added in v0.27.0

func (s *Structural) Format() string

func (*Structural) IsXEmbeddedResource added in v0.27.0

func (s *Structural) IsXEmbeddedResource() bool

func (*Structural) IsXIntOrString added in v0.27.0

func (s *Structural) IsXIntOrString() bool

func (*Structural) IsXPreserveUnknownFields added in v0.27.0

func (s *Structural) IsXPreserveUnknownFields() bool

func (*Structural) Items added in v0.27.0

func (s *Structural) Items() common.Schema

func (*Structural) MaxItems added in v0.27.0

func (s *Structural) MaxItems() *int64

func (*Structural) MaxLength added in v0.27.0

func (s *Structural) MaxLength() *int64

func (*Structural) MaxProperties added in v0.27.0

func (s *Structural) MaxProperties() *int64

func (*Structural) Nullable added in v0.27.0

func (s *Structural) Nullable() bool

func (*Structural) Properties added in v0.27.0

func (s *Structural) Properties() map[string]common.Schema

func (*Structural) Required added in v0.27.0

func (s *Structural) Required() []string

func (*Structural) Type added in v0.27.0

func (s *Structural) Type() string

func (*Structural) WithTypeAndObjectMeta added in v0.27.0

func (s *Structural) WithTypeAndObjectMeta() common.Schema

func (*Structural) XListMapKeys added in v0.27.0

func (s *Structural) XListMapKeys() []string

func (*Structural) XListType added in v0.27.0

func (s *Structural) XListType() string

type StructuralOrBool added in v0.27.0

type StructuralOrBool struct {
	StructuralOrBool *schema.StructuralOrBool
}

func (*StructuralOrBool) Allows added in v0.27.0

func (sb *StructuralOrBool) Allows() bool

func (*StructuralOrBool) Schema added in v0.27.0

func (sb *StructuralOrBool) Schema() common.Schema

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL