model

package
v0.31.3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 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) AllOf added in v0.29.0

func (s *Structural) AllOf() []common.Schema

func (*Structural) AnyOf added in v0.29.0

func (s *Structural) AnyOf() []common.Schema

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) IsExclusiveMaximum added in v0.29.0

func (s *Structural) IsExclusiveMaximum() bool

func (*Structural) IsExclusiveMinimum added in v0.29.0

func (s *Structural) IsExclusiveMinimum() bool

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) Maximum added in v0.29.0

func (s *Structural) Maximum() *float64

func (*Structural) MinItems added in v0.29.0

func (s *Structural) MinItems() *int64

func (*Structural) MinLength added in v0.29.0

func (s *Structural) MinLength() *int64

func (*Structural) MinProperties added in v0.29.0

func (s *Structural) MinProperties() *int64

func (*Structural) Minimum added in v0.29.0

func (s *Structural) Minimum() *float64

func (*Structural) MultipleOf added in v0.29.0

func (s *Structural) MultipleOf() *float64

func (*Structural) Not added in v0.29.0

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

func (*Structural) Nullable added in v0.27.0

func (s *Structural) Nullable() bool

func (*Structural) OneOf added in v0.29.0

func (s *Structural) OneOf() []common.Schema

func (*Structural) Pattern added in v0.29.0

func (s *Structural) Pattern() string

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) UniqueItems added in v0.29.0

func (s *Structural) UniqueItems() bool

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

func (*Structural) XMapType added in v0.29.0

func (s *Structural) XMapType() string

func (*Structural) XValidations added in v0.29.0

func (s *Structural) XValidations() []common.ValidationRule

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

type StructuralValidationRule added in v0.29.0

type StructuralValidationRule struct {
	// contains filtered or unexported fields
}

func (*StructuralValidationRule) FieldPath added in v0.29.0

func (s *StructuralValidationRule) FieldPath() string

func (*StructuralValidationRule) Message added in v0.29.0

func (s *StructuralValidationRule) Message() string

func (*StructuralValidationRule) MessageExpression added in v0.29.0

func (s *StructuralValidationRule) MessageExpression() string

func (*StructuralValidationRule) Rule added in v0.29.0

func (s *StructuralValidationRule) Rule() string

Jump to

Keyboard shortcuts

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