apiserverk8s.io/apiserver/pkg/cel/lazy Index | Files

package lazy

import "k8s.io/apiserver/pkg/cel/lazy"

Index

Types

type GetFieldFunc

type GetFieldFunc func(*MapValue) ref.Val

type MapValue

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

MapValue is a map that lazily evaluate its value when a field is first accessed. The map value is not designed to be thread-safe.

func NewMapValue

func NewMapValue(objectType ref.Type) *MapValue

func (*MapValue) Append

func (m *MapValue) Append(name string, callback GetFieldFunc)

Append adds the given field with its name and callback.

func (*MapValue) Contains

func (m *MapValue) Contains(key ref.Val) ref.Val

Contains checks if the key is known to the map

func (*MapValue) ConvertToNative

func (m *MapValue) ConvertToNative(typeDesc reflect.Type) (any, error)

ConvertToNative returns an error because it is disallowed

func (*MapValue) ConvertToType

func (m *MapValue) ConvertToType(typeVal ref.Type) ref.Val

ConvertToType converts the map to the given type. Only its own type and "Type" type are allowed.

func (*MapValue) Equal

func (m *MapValue) Equal(other ref.Val) ref.Val

Equal returns true if the other object is the same pointer-wise.

func (*MapValue) Find

func (m *MapValue) Find(key ref.Val) (ref.Val, bool)

func (*MapValue) Get

func (m *MapValue) Get(key ref.Val) ref.Val

func (*MapValue) Iterator

func (m *MapValue) Iterator() traits.Iterator

Iterator returns an iterator to traverse the map.

func (*MapValue) Size

func (m *MapValue) Size() ref.Val

Size returns the number of currently known fields

func (*MapValue) Type

func (m *MapValue) Type() ref.Type

Type returns its registered type.

func (*MapValue) Value

func (m *MapValue) Value() any

Value is not allowed.

Source Files

lazy.go

Version
v0.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
1 hour ago

Tools for package owners.