apiserverk8s.io/apiserver/pkg/cel/mutation/unstructured Index | Files

package unstructured

import "k8s.io/apiserver/pkg/cel/mutation/unstructured"

Index

Functions

func NewFieldType

func NewFieldType(name string) *types.FieldType

NewFieldType creates a field by its field name. This version of FieldType is unstructured and has DynType as its type.

Types

type TypeRef

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

TypeRef is the implementation of TypeRef for an unstructured object. This is especially usefully when the schema is not known or available.

func NewTypeRef

func NewTypeRef(name string) *TypeRef

NewTypeRef creates a TypeRef by the given field name.

func (*TypeRef) CELType

func (r *TypeRef) CELType() *types.Type

CELType returns the type. The returned type is of TypeType type.

func (*TypeRef) Field

func (r *TypeRef) Field(name string) (*types.FieldType, bool)

Field looks up the field by name. This is the unstructured version that allows any name as the field name. The returned field is of DynType type.

func (*TypeRef) HasTrait

func (r *TypeRef) HasTrait(trait int) bool

func (*TypeRef) TypeName

func (r *TypeRef) TypeName() string

TypeName returns the name of this TypeRef.

func (*TypeRef) Val

func (r *TypeRef) Val(fields map[string]ref.Val) ref.Val

Val returns an instance given the fields.

type TypeResolver

type TypeResolver struct {
}

func (*TypeResolver) Resolve

func (r *TypeResolver) Resolve(name string) (common.TypeRef, bool)

Resolve resolves the TypeRef for the given type name that starts with "Object". This is the unstructured version, which means the returned TypeRef does not refer to the schema.

Source Files

fieldtype.go typeref.go typeresolver.go

Version
v0.30.0-alpha.1
Published
Jan 31, 2024
Platform
js/wasm
Imports
5 packages
Last checked
5 minutes ago

Tools for package owners.