| 1 | // Copyright 2018 Google LLC |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/ |
| 16 | |
| 17 | import ( |
| 18 | "fmtscip-go gomod github.com/golang/go/src go1.23.0 fmt/" |
| 19 | "reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/" |
| 20 | "timescip-go gomod github.com/golang/go/src go1.23.0 time/" |
| 21 | |
| 22 | "google.golang.org/protobuf/protoscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/" |
| 23 | "google.golang.org/protobuf/reflect/protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/" |
| 24 | |
| 25 | "github.com/google/cel-go/common/types/pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/" |
| 26 | "github.com/google/cel-go/common/types/refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/" |
| 27 | "github.com/google/cel-go/common/types/traitsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/" |
| 28 | |
| 29 | exprpbscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/ "google.golang.org/genproto/googleapis/api/expr/v1alpha1scip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/" |
| 30 | anypbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/anypb`/ "google.golang.org/protobuf/types/known/anypbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/anypb`/" |
| 31 | dpbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/durationpb`/ "google.golang.org/protobuf/types/known/durationpbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/durationpb`/" |
| 32 | structpbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/structpb`/ "google.golang.org/protobuf/types/known/structpbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/structpb`/" |
| 33 | tpbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/timestamppb`/ "google.golang.org/protobuf/types/known/timestamppbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/timestamppb`/" |
| 34 | ) |
| 35 | |
| 36 | // Adapter converts native Go values of varying type and complexity to equivalent CEL values. |
| 37 | type Adapterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Adapter# = refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.TypeAdapterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeAdapter# |
| 38 | |
| 39 | // Provider specifies functions for creating new object instances and for resolving |
| 40 | // enum values by name. |
| 41 | type Providerscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Provider# interface { |
| 42 | // EnumValue returns the numeric value of the given enum value name. |
| 43 | EnumValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Provider#EnumValue.(enumName string) refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val# |
| 44 | |
| 45 | // FindIdent takes a qualified identifier name and returns a ref.Val if one exists. |
| 46 | FindIdentscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Provider#FindIdent.(identName string) (refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#, bool) |
| 47 | |
| 48 | // FindStructType returns the Type give a qualified type name. |
| 49 | // |
| 50 | // For historical reasons, only struct types are expected to be returned through this |
| 51 | // method, and the type values are expected to be wrapped in a TypeType instance using |
| 52 | // TypeTypeWithParam(<structType>). |
| 53 | // |
| 54 | // Returns false if not found. |
| 55 | FindStructTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Provider#FindStructType.(structType string) (*Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#, bool) |
| 56 | |
| 57 | // FindStructFieldNames returns thet field names associated with the type, if the type |
| 58 | // is found. |
| 59 | FindStructFieldNamesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Provider#FindStructFieldNames.(structType string) ([]string, bool) |
| 60 | |
| 61 | // FieldStructFieldType returns the field type for a checked type value. Returns |
| 62 | // false if the field could not be found. |
| 63 | FindStructFieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Provider#FindStructFieldType.(structType, fieldName string) (*FieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/FieldType#, bool) |
| 64 | |
| 65 | // NewValue creates a new type value from a qualified name and map of field |
| 66 | // name to value. |
| 67 | // |
| 68 | // Note, for each value, the Val.ConvertToNative function will be invoked |
| 69 | // to convert the Val to the field's native type. If an error occurs during |
| 70 | // conversion, the NewValue will be a types.Err. |
| 71 | NewValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Provider#NewValue.(structType string, fields map[string]refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#) refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val# |
| 72 | } |
| 73 | |
| 74 | // FieldType represents a field's type value and whether that field supports presence detection. |
| 75 | type FieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/FieldType# struct { |
| 76 | // Type of the field as a CEL native type value. |
| 77 | Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/FieldType#Type. *Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type# |
| 78 | |
| 79 | // IsSet indicates whether the field is set on an input object. |
| 80 | IsSetscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/FieldType#IsSet. refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.FieldTesterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldTester# |
| 81 | |
| 82 | // GetFrom retrieves the field value on the input object, if set. |
| 83 | GetFromscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/FieldType#GetFrom. refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.FieldGetterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldGetter# |
| 84 | } |
| 85 | |
| 86 | // Registry provides type information for a set of registered types. |
| 87 | type Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry# struct { |
| 88 | revTypeMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#revTypeMap. map[string]*Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type# |
| 89 | pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb. *pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.Dbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db# |
| 90 | } |
| 91 | |
| 92 | // NewRegistry accepts a list of proto message instances and returns a type |
| 93 | // provider which can create new instances of the provided message or any |
| 94 | // message that proto depends upon in its FileDescriptor. |
| 95 | func NewRegistryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewRegistry().(types ...protoscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/.Messagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/Message#) (*Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#, error) { |
| 96 | p := &Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#{ |
| 97 | revTypeMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#revTypeMap.: make(map[string]*Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#), |
| 98 | pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb.: pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.NewDbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/NewDb().(), |
| 99 | } |
| 100 | err := p.RegisterTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#RegisterType().( |
| 101 | BoolTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/BoolType., |
| 102 | BytesTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/BytesType., |
| 103 | DoubleTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/DoubleType., |
| 104 | DurationTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/DurationType., |
| 105 | IntTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/IntType., |
| 106 | ListTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/ListType., |
| 107 | MapTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/MapType., |
| 108 | NullTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NullType., |
| 109 | StringTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/StringType., |
| 110 | TimestampTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/TimestampType., |
| 111 | TypeTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/TypeType., |
| 112 | UintTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UintType.) |
| 113 | if err != nil { |
| 114 | return nil, err |
| 115 | } |
| 116 | // This block ensures that the well-known protobuf types are registered by default. |
| 117 | for _, fd := range p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..FileDescriptionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#FileDescriptions().() { |
| 118 | err = p.registerAllTypesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#registerAllTypes().(fd) |
| 119 | if err != nil { |
| 120 | return nil, err |
| 121 | } |
| 122 | } |
| 123 | for _, msgType := range types { |
| 124 | err = p.RegisterMessagescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#RegisterMessage().(msgType) |
| 125 | if err != nil { |
| 126 | return nil, err |
| 127 | } |
| 128 | } |
| 129 | return p, nil |
| 130 | } |
| 131 | |
| 132 | // NewEmptyRegistry returns a registry which is completely unconfigured. |
| 133 | func NewEmptyRegistryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewEmptyRegistry().() *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry# { |
| 134 | return &Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#{ |
| 135 | revTypeMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#revTypeMap.: make(map[string]*Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#), |
| 136 | pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb.: pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.NewDbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/NewDb().(), |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | // Copy copies the current state of the registry into its own memory space. |
| 141 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) Copyscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#Copy().() *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry# { |
| 142 | copy := &Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#{ |
| 143 | revTypeMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#revTypeMap.: make(map[string]*Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#), |
| 144 | pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb.: p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..Copyscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#Copy().(), |
| 145 | } |
| 146 | for k, v := range p.revTypeMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#revTypeMap. { |
| 147 | copy.revTypeMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#revTypeMap.[k] = v |
| 148 | } |
| 149 | return copy |
| 150 | } |
| 151 | |
| 152 | // EnumValue returns the numeric value of the given enum value name. |
| 153 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) EnumValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#EnumValue().(enumName string) refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val# { |
| 154 | enumVal, found := p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..DescribeEnumscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#DescribeEnum().(enumName) |
| 155 | if !found { |
| 156 | return NewErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewErr().("unknown enum name '%s'", enumName) |
| 157 | } |
| 158 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(enumVal.Valuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/EnumValueDescription#Value().()) |
| 159 | } |
| 160 | |
| 161 | // FindFieldType returns the field type for a checked type value. Returns false if |
| 162 | // the field could not be found. |
| 163 | // |
| 164 | // Deprecated: use FindStructFieldType |
| 165 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) FindFieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#FindFieldType().(structType, fieldName string) (*refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.FieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldType#, bool) { |
| 166 | msgType, found := p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..DescribeTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#DescribeType().(structType) |
| 167 | if !found { |
| 168 | return nil, false |
| 169 | } |
| 170 | field, found := msgType.FieldByNamescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/TypeDescription#FieldByName().(fieldName) |
| 171 | if !found { |
| 172 | return nil, false |
| 173 | } |
| 174 | return &refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.FieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldType#{ |
| 175 | Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldType#Type.: field.CheckedTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#CheckedType().(), |
| 176 | IsSetscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldType#IsSet.: field.IsSetscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#IsSet()., |
| 177 | GetFromscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldType#GetFrom.: field.GetFromscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#GetFrom().}, true |
| 178 | } |
| 179 | |
| 180 | // FindStructFieldNames returns the set of field names for the given struct type, |
| 181 | // if the type exists in the registry. |
| 182 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) FindStructFieldNamesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#FindStructFieldNames().(structType string) ([]string, bool) { |
| 183 | msgType, found := p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..DescribeTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#DescribeType().(structType) |
| 184 | if !found { |
| 185 | return []string{}, false |
| 186 | } |
| 187 | fieldMap := msgType.FieldMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/TypeDescription#FieldMap().() |
| 188 | fields := make([]string, len(fieldMap)) |
| 189 | idx := 0 |
| 190 | for f := range fieldMap { |
| 191 | fields[idx] = f |
| 192 | idx++ |
| 193 | } |
| 194 | return fields, true |
| 195 | } |
| 196 | |
| 197 | // FindStructFieldType returns the field type for a checked type value. Returns |
| 198 | // false if the field could not be found. |
| 199 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) FindStructFieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#FindStructFieldType().(structType, fieldName string) (*FieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/FieldType#, bool) { |
| 200 | msgType, found := p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..DescribeTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#DescribeType().(structType) |
| 201 | if !found { |
| 202 | return nil, false |
| 203 | } |
| 204 | field, found := msgType.FieldByNamescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/TypeDescription#FieldByName().(fieldName) |
| 205 | if !found { |
| 206 | return nil, false |
| 207 | } |
| 208 | return &FieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/FieldType#{ |
| 209 | Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/FieldType#Type.: fieldDescToCELTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/fieldDescToCELType().(field), |
| 210 | IsSetscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/FieldType#IsSet.: field.IsSetscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#IsSet()., |
| 211 | GetFromscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/FieldType#GetFrom.: field.GetFromscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#GetFrom().}, true |
| 212 | } |
| 213 | |
| 214 | // FindIdent takes a qualified identifier name and returns a ref.Val if one exists. |
| 215 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) FindIdentscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#FindIdent().(identName string) (refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#, bool) { |
| 216 | if t, found := p.revTypeMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#revTypeMap.[identName]; found { |
| 217 | return t, true |
| 218 | } |
| 219 | if enumVal, found := p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..DescribeEnumscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#DescribeEnum().(identName); found { |
| 220 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(enumVal.Valuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/EnumValueDescription#Value().()), true |
| 221 | } |
| 222 | return nil, false |
| 223 | } |
| 224 | |
| 225 | // FindType looks up the Type given a qualified typeName. Returns false if not found. |
| 226 | // |
| 227 | // Deprecated: use FindStructType |
| 228 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) FindTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#FindType().(structType string) (*exprpbscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/.Typescip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/Type#, bool) { |
| 229 | if _, found := p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..DescribeTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#DescribeType().(structType); !found { |
| 230 | return nil, false |
| 231 | } |
| 232 | if structType != "" && structType[0] == '.' { |
| 233 | structType = structType[1:] |
| 234 | } |
| 235 | return &exprpbscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/.Typescip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/Type#{ |
| 236 | TypeKindscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/Type#TypeKind.: &exprpbscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/.Type_Typescip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/Type_Type#{ |
| 237 | Typescip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/Type_Type#Type.: &exprpbscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/.Typescip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/Type#{ |
| 238 | TypeKindscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/Type#TypeKind.: &exprpbscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/.Type_MessageTypescip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/Type_MessageType#{ |
| 239 | MessageTypescip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/Type_MessageType#MessageType.: structType}}}}, true |
| 240 | } |
| 241 | |
| 242 | // FindStructType returns the Type give a qualified type name. |
| 243 | // |
| 244 | // For historical reasons, only struct types are expected to be returned through this |
| 245 | // method, and the type values are expected to be wrapped in a TypeType instance using |
| 246 | // TypeTypeWithParam(<structType>). |
| 247 | // |
| 248 | // Returns false if not found. |
| 249 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) FindStructTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#FindStructType().(structType string) (*Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#, bool) { |
| 250 | if _, found := p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..DescribeTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#DescribeType().(structType); !found { |
| 251 | return nil, false |
| 252 | } |
| 253 | if structType != "" && structType[0] == '.' { |
| 254 | structType = structType[1:] |
| 255 | } |
| 256 | return NewTypeTypeWithParamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewTypeTypeWithParam().(NewObjectTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewObjectType().(structType)), true |
| 257 | } |
| 258 | |
| 259 | // NewValue creates a new type value from a qualified name and map of field |
| 260 | // name to value. |
| 261 | // |
| 262 | // Note, for each value, the Val.ConvertToNative function will be invoked |
| 263 | // to convert the Val to the field's native type. If an error occurs during |
| 264 | // conversion, the NewValue will be a types.Err. |
| 265 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) NewValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#NewValue().(structType string, fields map[string]refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#) refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val# { |
| 266 | td, found := p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..DescribeTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#DescribeType().(structType) |
| 267 | if !found { |
| 268 | return NewErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewErr().("unknown type '%s'", structType) |
| 269 | } |
| 270 | msg := td.Newscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/TypeDescription#New().() |
| 271 | fieldMap := td.FieldMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/TypeDescription#FieldMap().() |
| 272 | for name, value := range fields { |
| 273 | field, found := fieldMap[name] |
| 274 | if !found { |
| 275 | return NewErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewErr().("no such field: %s", name) |
| 276 | } |
| 277 | err := msgSetFieldscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/msgSetField().(msg, field, value) |
| 278 | if err != nil { |
| 279 | return &Errscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Err#{errorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Err#error.: err} |
| 280 | } |
| 281 | } |
| 282 | return p.NativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#NativeToValue().(msg.Interfacescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#Interface().()) |
| 283 | } |
| 284 | |
| 285 | // RegisterDescriptor registers the contents of a protocol buffer `FileDescriptor`. |
| 286 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) RegisterDescriptorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#RegisterDescriptor().(fileDesc protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.FileDescriptorscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/FileDescriptor#) error { |
| 287 | fd, err := p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..RegisterDescriptorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#RegisterDescriptor().(fileDesc) |
| 288 | if err != nil { |
| 289 | return err |
| 290 | } |
| 291 | return p.registerAllTypesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#registerAllTypes().(fd) |
| 292 | } |
| 293 | |
| 294 | // RegisterMessage registers a protocol buffer message and its dependencies. |
| 295 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) RegisterMessagescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#RegisterMessage().(message protoscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/.Messagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/Message#) error { |
| 296 | fd, err := p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..RegisterMessagescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#RegisterMessage().(message) |
| 297 | if err != nil { |
| 298 | return err |
| 299 | } |
| 300 | return p.registerAllTypesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#registerAllTypes().(fd) |
| 301 | } |
| 302 | |
| 303 | // RegisterType registers a type value with the provider which ensures the provider is aware of how to |
| 304 | // map the type to an identifier. |
| 305 | // |
| 306 | // If the `ref.Type` value is a `*types.Type` it will be registered directly by its runtime type name. |
| 307 | // If the `ref.Type` value is not a `*types.Type` instance, a `*types.Type` instance which reflects the |
| 308 | // traits present on the input and the runtime type name. By default this foreign type will be treated |
| 309 | // as a types.StructKind. To avoid potential issues where the `ref.Type` values does not match the |
| 310 | // generated `*types.Type` instance, consider always using the `*types.Type` to represent type extensions |
| 311 | // to CEL, even when they're not based on protobuf types. |
| 312 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) RegisterTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#RegisterType().(types ...refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Type#) error { |
| 313 | for _, t := range types { |
| 314 | celType := maybeForeignTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/maybeForeignType().(t) |
| 315 | existing, found := p.revTypeMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#revTypeMap.[t.TypeNamescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Type#TypeName.()] |
| 316 | if !found { |
| 317 | p.revTypeMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#revTypeMap.[t.TypeNamescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Type#TypeName.()] = celType |
| 318 | continue |
| 319 | } |
| 320 | if !existing.IsEquivalentTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#IsEquivalentType().(celType) { |
| 321 | return fmtscip-go gomod github.com/golang/go/src go1.23.0 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.23.0 fmt/Errorf().("type registration conflict. found: %v, input: %v", existing, celType) |
| 322 | } |
| 323 | if existing.traitMaskscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#traitMask. != celType.traitMaskscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#traitMask. { |
| 324 | return fmtscip-go gomod github.com/golang/go/src go1.23.0 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.23.0 fmt/Errorf().( |
| 325 | "type registered with conflicting traits: %v with traits %v, input: %v", |
| 326 | existing.TypeNamescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#TypeName().(), existing.traitMaskscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#traitMask., celType.traitMaskscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#traitMask.) |
| 327 | } |
| 328 | } |
| 329 | return nil |
| 330 | } |
| 331 | |
| 332 | // NativeToValue converts various "native" types to ref.Val with this specific implementation |
| 333 | // providing support for custom proto-based types. |
| 334 | // |
| 335 | // This method should be the inverse of ref.Val.ConvertToNative. |
| 336 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) NativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#NativeToValue().(value any) refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val# { |
| 337 | if val, found := nativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/nativeToValue().(p, value); found { |
| 338 | return val |
| 339 | } |
| 340 | switch v := value.(type) { |
| 341 | case protoscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/.Messagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/Message#: |
| 342 | typeName := string(v.ProtoReflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/ProtoMessage#ProtoReflect().().Descriptorscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#Descriptor().().FullNamescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Descriptor#FullName().()) |
| 343 | td, found := p.pbdbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#pbdb..DescribeTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#DescribeType().(typeName) |
| 344 | if !found { |
| 345 | return NewErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewErr().("unknown type: '%s'", typeName) |
| 346 | } |
| 347 | unwrapped, isUnwrapped, err := td.MaybeUnwrapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/TypeDescription#MaybeUnwrap().(v) |
| 348 | if err != nil { |
| 349 | return UnsupportedRefValConversionErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UnsupportedRefValConversionErr().(v) |
| 350 | } |
| 351 | if isUnwrapped { |
| 352 | return p.NativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#NativeToValue().(unwrapped) |
| 353 | } |
| 354 | typeVal, found := p.FindIdentscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#FindIdent().(typeName) |
| 355 | if !found { |
| 356 | return NewErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewErr().("unknown type: '%s'", typeName) |
| 357 | } |
| 358 | return NewObjectscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewObject().(p, td, typeVal, v) |
| 359 | case *pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.Mapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Map#: |
| 360 | return NewProtoMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewProtoMap().(p, v) |
| 361 | case protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Listscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/List#: |
| 362 | return NewProtoListscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewProtoList().(p, v) |
| 363 | case protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Messagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#: |
| 364 | return p.NativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#NativeToValue().(v.Interfacescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#Interface().()) |
| 365 | case protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Valuescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Value#: |
| 366 | return p.NativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#NativeToValue().(v.Interfacescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Value#Interface().()) |
| 367 | } |
| 368 | return UnsupportedRefValConversionErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UnsupportedRefValConversionErr().(value) |
| 369 | } |
| 370 | |
| 371 | func (p *Registryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#) registerAllTypesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#registerAllTypes().(fd *pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.FileDescriptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FileDescription#) error { |
| 372 | for _, typeName := range fd.GetTypeNamesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FileDescription#GetTypeNames().() { |
| 373 | // skip well-known type names since they're automatically sanitized |
| 374 | // during NewObjectType() calls. |
| 375 | if _, found := checkedWellKnownsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/checkedWellKnowns.[typeName]; found { |
| 376 | continue |
| 377 | } |
| 378 | err := p.RegisterTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Registry#RegisterType().(NewObjectTypeValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewObjectTypeValue().(typeName)) |
| 379 | if err != nil { |
| 380 | return err |
| 381 | } |
| 382 | } |
| 383 | return nil |
| 384 | } |
| 385 | |
| 386 | func fieldDescToCELTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/fieldDescToCELType().(field *pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.FieldDescriptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#) *Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type# { |
| 387 | if field.IsMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#IsMap().() { |
| 388 | return NewMapTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewMapType().( |
| 389 | singularFieldDescToCELTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/singularFieldDescToCELType().(field.KeyTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#KeyType.), |
| 390 | singularFieldDescToCELTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/singularFieldDescToCELType().(field.ValueTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#ValueType.)) |
| 391 | } |
| 392 | if field.IsListscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#IsList().() { |
| 393 | return NewListTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewListType().(singularFieldDescToCELTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/singularFieldDescToCELType().(field)) |
| 394 | } |
| 395 | return singularFieldDescToCELTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/singularFieldDescToCELType().(field) |
| 396 | } |
| 397 | |
| 398 | func singularFieldDescToCELTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/singularFieldDescToCELType().(field *pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.FieldDescriptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#) *Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type# { |
| 399 | if field.IsMessagescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#IsMessage().() { |
| 400 | return NewObjectTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewObjectType().(string(field.Descriptorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#Descriptor().().Messagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/FieldDescriptor#Message().().FullNamescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Descriptor#FullName().())) |
| 401 | } |
| 402 | if field.IsEnumscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#IsEnum().() { |
| 403 | return IntTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/IntType. |
| 404 | } |
| 405 | return ProtoCELPrimitivesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/ProtoCELPrimitives.[field.ProtoKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#ProtoKind().()] |
| 406 | } |
| 407 | |
| 408 | // defaultTypeAdapter converts go native types to CEL values. |
| 409 | type defaultTypeAdapterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/defaultTypeAdapter# struct{} |
| 410 | |
| 411 | var ( |
| 412 | // DefaultTypeAdapter adapts canonical CEL types from their equivalent Go values. |
| 413 | DefaultTypeAdapterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/DefaultTypeAdapter. = &defaultTypeAdapterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/defaultTypeAdapter#{} |
| 414 | ) |
| 415 | |
| 416 | // NativeToValue implements the ref.TypeAdapter interface. |
| 417 | func (a *defaultTypeAdapterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/defaultTypeAdapter#) NativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/defaultTypeAdapter#NativeToValue().(value any) refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val# { |
| 418 | if val, found := nativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/nativeToValue().(a, value); found { |
| 419 | return val |
| 420 | } |
| 421 | return UnsupportedRefValConversionErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UnsupportedRefValConversionErr().(value) |
| 422 | } |
| 423 | |
| 424 | // nativeToValue returns the converted (ref.Val, true) of a conversion is found, |
| 425 | // otherwise (nil, false) |
| 426 | func nativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/nativeToValue().(a Adapterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Adapter#, value any) (refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#, bool) { |
| 427 | switch v := value.(type) { |
| 428 | case nil: |
| 429 | return NullValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NullValue., true |
| 430 | case *Boolscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Bool#: |
| 431 | if v != nil { |
| 432 | return *v, true |
| 433 | } |
| 434 | case *Bytesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Bytes#: |
| 435 | if v != nil { |
| 436 | return *v, true |
| 437 | } |
| 438 | case *Doublescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Double#: |
| 439 | if v != nil { |
| 440 | return *v, true |
| 441 | } |
| 442 | case *Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#: |
| 443 | if v != nil { |
| 444 | return *v, true |
| 445 | } |
| 446 | case *Stringscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/String#: |
| 447 | if v != nil { |
| 448 | return *v, true |
| 449 | } |
| 450 | case *Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#: |
| 451 | if v != nil { |
| 452 | return *v, true |
| 453 | } |
| 454 | case bool: |
| 455 | return Boolscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Bool#(v), true |
| 456 | case int: |
| 457 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(v), true |
| 458 | case int32: |
| 459 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(v), true |
| 460 | case int64: |
| 461 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(v), true |
| 462 | case uint: |
| 463 | return Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#(v), true |
| 464 | case uint32: |
| 465 | return Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#(v), true |
| 466 | case uint64: |
| 467 | return Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#(v), true |
| 468 | case float32: |
| 469 | return Doublescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Double#(v), true |
| 470 | case float64: |
| 471 | return Doublescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Double#(v), true |
| 472 | case string: |
| 473 | return Stringscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/String#(v), true |
| 474 | case *dpbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/durationpb`/.Durationscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/durationpb`/Duration#: |
| 475 | return Durationscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Duration#{Durationscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Duration#Duration.: v.AsDurationscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/durationpb`/Duration#AsDuration().()}, true |
| 476 | case timescip-go gomod github.com/golang/go/src go1.23.0 time/.Durationscip-go gomod github.com/golang/go/src go1.23.0 time/Duration#: |
| 477 | return Durationscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Duration#{Durationscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Duration#Duration.: v}, true |
| 478 | case *tpbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/timestamppb`/.Timestampscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/timestamppb`/Timestamp#: |
| 479 | return Timestampscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Timestamp#{Timescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Timestamp#Time.: v.AsTimescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/timestamppb`/Timestamp#AsTime().()}, true |
| 480 | case timescip-go gomod github.com/golang/go/src go1.23.0 time/.Timescip-go gomod github.com/golang/go/src go1.23.0 time/Time#: |
| 481 | return Timestampscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Timestamp#{Timescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Timestamp#Time.: v}, true |
| 482 | case *bool: |
| 483 | if v != nil { |
| 484 | return Boolscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Bool#(*v), true |
| 485 | } |
| 486 | case *float32: |
| 487 | if v != nil { |
| 488 | return Doublescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Double#(*v), true |
| 489 | } |
| 490 | case *float64: |
| 491 | if v != nil { |
| 492 | return Doublescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Double#(*v), true |
| 493 | } |
| 494 | case *int: |
| 495 | if v != nil { |
| 496 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(*v), true |
| 497 | } |
| 498 | case *int32: |
| 499 | if v != nil { |
| 500 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(*v), true |
| 501 | } |
| 502 | case *int64: |
| 503 | if v != nil { |
| 504 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(*v), true |
| 505 | } |
| 506 | case *string: |
| 507 | if v != nil { |
| 508 | return Stringscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/String#(*v), true |
| 509 | } |
| 510 | case *uint: |
| 511 | if v != nil { |
| 512 | return Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#(*v), true |
| 513 | } |
| 514 | case *uint32: |
| 515 | if v != nil { |
| 516 | return Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#(*v), true |
| 517 | } |
| 518 | case *uint64: |
| 519 | if v != nil { |
| 520 | return Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#(*v), true |
| 521 | } |
| 522 | case []byte: |
| 523 | return Bytesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Bytes#(v), true |
| 524 | // specializations for common lists types. |
| 525 | case []string: |
| 526 | return NewStringListscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewStringList().(a, v), true |
| 527 | case []refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#: |
| 528 | return NewRefValListscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewRefValList().(a, v), true |
| 529 | // specializations for common map types. |
| 530 | case map[string]string: |
| 531 | return NewStringStringMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewStringStringMap().(a, v), true |
| 532 | case map[string]any: |
| 533 | return NewStringInterfaceMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewStringInterfaceMap().(a, v), true |
| 534 | case map[refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#]refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#: |
| 535 | return NewRefValMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewRefValMap().(a, v), true |
| 536 | // additional specializations may be added upon request / need. |
| 537 | case *anypbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/anypb`/.Anyscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/anypb`/Any#: |
| 538 | if v == nil { |
| 539 | return UnsupportedRefValConversionErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UnsupportedRefValConversionErr().(v), true |
| 540 | } |
| 541 | unpackedAny, err := v.UnmarshalNewscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/anypb`/Any#UnmarshalNew().() |
| 542 | if err != nil { |
| 543 | return NewErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewErr().("anypb.UnmarshalNew() failed for type %q: %v", v.GetTypeUrlscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/anypb`/Any#GetTypeUrl().(), err), true |
| 544 | } |
| 545 | return a.NativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeAdapter#NativeToValue.(unpackedAny), true |
| 546 | case *structpbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/structpb`/.NullValuescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/structpb`/NullValue#, structpbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/structpb`/.NullValuescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/structpb`/NullValue#: |
| 547 | return NullValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NullValue., true |
| 548 | case *structpbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/structpb`/.ListValuescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/structpb`/ListValue#: |
| 549 | return NewJSONListscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewJSONList().(a, v), true |
| 550 | case *structpbscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/structpb`/.Structscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/types/known/structpb`/Struct#: |
| 551 | return NewJSONStructscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewJSONStruct().(a, v), true |
| 552 | case refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#: |
| 553 | return v, true |
| 554 | case protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.EnumNumberscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/EnumNumber#: |
| 555 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(v), true |
| 556 | case protoscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/.Messagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/Message#: |
| 557 | if v == nil { |
| 558 | return UnsupportedRefValConversionErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UnsupportedRefValConversionErr().(v), true |
| 559 | } |
| 560 | typeName := string(v.ProtoReflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/ProtoMessage#ProtoReflect().().Descriptorscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#Descriptor().().FullNamescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Descriptor#FullName().()) |
| 561 | td, found := pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.DefaultDbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/DefaultDb..DescribeTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/Db#DescribeType().(typeName) |
| 562 | if !found { |
| 563 | return nil, false |
| 564 | } |
| 565 | val, unwrapped, err := td.MaybeUnwrapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/TypeDescription#MaybeUnwrap().(v) |
| 566 | if err != nil { |
| 567 | return UnsupportedRefValConversionErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UnsupportedRefValConversionErr().(v), true |
| 568 | } |
| 569 | if !unwrapped { |
| 570 | return nil, false |
| 571 | } |
| 572 | return a.NativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeAdapter#NativeToValue.(val), true |
| 573 | // Note: dynamicpb.Message implements the proto.Message _and_ protoreflect.Message interfaces |
| 574 | // which means that this case must appear after handling a proto.Message type. |
| 575 | case protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Messagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#: |
| 576 | return a.NativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeAdapter#NativeToValue.(v.Interfacescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#Interface().()), true |
| 577 | default: |
| 578 | refValue := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/ValueOf().(v) |
| 579 | if refValue.Kindscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Kind().() == reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Ptrscip-go gomod github.com/golang/go/src go1.23.0 reflect/Ptr. { |
| 580 | if refValue.IsNilscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#IsNil().() { |
| 581 | return UnsupportedRefValConversionErrscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UnsupportedRefValConversionErr().(v), true |
| 582 | } |
| 583 | refValue = refValue.Elemscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Elem().() |
| 584 | } |
| 585 | refKind := refValue.Kindscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Kind().() |
| 586 | switch refKind { |
| 587 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Arrayscip-go gomod github.com/golang/go/src go1.23.0 reflect/Array., reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Slicescip-go gomod github.com/golang/go/src go1.23.0 reflect/Slice.: |
| 588 | if refValue.Typescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Type().().Elemscip-go gomod github.com/golang/go/src go1.23.0 reflect/Type#Elem().() == reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(byte(0)) { |
| 589 | if refValue.CanAddrscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#CanAddr().() { |
| 590 | return Bytesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Bytes#(refValue.Bytesscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Bytes().()), true |
| 591 | } |
| 592 | tmp := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Newscip-go gomod github.com/golang/go/src go1.23.0 reflect/New().(refValue.Typescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Type().()) |
| 593 | tmp.Elemscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Elem().().Setscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Set().(refValue) |
| 594 | return Bytesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Bytes#(tmp.Elemscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Elem().().Bytesscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Bytes().()), true |
| 595 | } |
| 596 | return NewDynamicListscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewDynamicList().(a, v), true |
| 597 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Mapscip-go gomod github.com/golang/go/src go1.23.0 reflect/Map.: |
| 598 | return NewDynamicMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewDynamicMap().(a, v), true |
| 599 | // type aliases of primitive types cannot be asserted as that type, but rather need |
| 600 | // to be downcast to int32 before being converted to a CEL representation. |
| 601 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Boolscip-go gomod github.com/golang/go/src go1.23.0 reflect/Bool.: |
| 602 | boolTupe := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(false) |
| 603 | return Boolscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Bool#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(boolTupe).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(bool)), true |
| 604 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Intscip-go gomod github.com/golang/go/src go1.23.0 reflect/Int.: |
| 605 | intType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(int(0)) |
| 606 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(intType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(int)), true |
| 607 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Int8scip-go gomod github.com/golang/go/src go1.23.0 reflect/Int8.: |
| 608 | intType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(int8(0)) |
| 609 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(intType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(int8)), true |
| 610 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Int16scip-go gomod github.com/golang/go/src go1.23.0 reflect/Int16.: |
| 611 | intType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(int16(0)) |
| 612 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(intType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(int16)), true |
| 613 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Int32scip-go gomod github.com/golang/go/src go1.23.0 reflect/Int32.: |
| 614 | intType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(int32(0)) |
| 615 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(intType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(int32)), true |
| 616 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Int64scip-go gomod github.com/golang/go/src go1.23.0 reflect/Int64.: |
| 617 | intType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(int64(0)) |
| 618 | return Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(intType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(int64)), true |
| 619 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Uintscip-go gomod github.com/golang/go/src go1.23.0 reflect/Uint.: |
| 620 | uintType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(uint(0)) |
| 621 | return Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(uintType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(uint)), true |
| 622 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Uint8scip-go gomod github.com/golang/go/src go1.23.0 reflect/Uint8.: |
| 623 | uintType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(uint8(0)) |
| 624 | return Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(uintType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(uint8)), true |
| 625 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Uint16scip-go gomod github.com/golang/go/src go1.23.0 reflect/Uint16.: |
| 626 | uintType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(uint16(0)) |
| 627 | return Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(uintType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(uint16)), true |
| 628 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Uint32scip-go gomod github.com/golang/go/src go1.23.0 reflect/Uint32.: |
| 629 | uintType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(uint32(0)) |
| 630 | return Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(uintType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(uint32)), true |
| 631 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Uint64scip-go gomod github.com/golang/go/src go1.23.0 reflect/Uint64.: |
| 632 | uintType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(uint64(0)) |
| 633 | return Uintscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Uint#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(uintType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(uint64)), true |
| 634 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Float32scip-go gomod github.com/golang/go/src go1.23.0 reflect/Float32.: |
| 635 | doubleType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(float32(0)) |
| 636 | return Doublescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Double#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(doubleType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(float32)), true |
| 637 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Float64scip-go gomod github.com/golang/go/src go1.23.0 reflect/Float64.: |
| 638 | doubleType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().(float64(0)) |
| 639 | return Doublescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Double#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(doubleType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(float64)), true |
| 640 | case reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.Stringscip-go gomod github.com/golang/go/src go1.23.0 reflect/String.: |
| 641 | stringType := reflectscip-go gomod github.com/golang/go/src go1.23.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.23.0 reflect/TypeOf().("") |
| 642 | return Stringscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/String#(refValue.Convertscip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Convert().(stringType).Interfacescip-go gomod github.com/golang/go/src go1.23.0 reflect/Value#Interface().().(string)), true |
| 643 | } |
| 644 | } |
| 645 | return nil, false |
| 646 | } |
| 647 | |
| 648 | func msgSetFieldscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/msgSetField().(target protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Messagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#, field *pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.FieldDescriptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#, val refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#) error { |
| 649 | if field.IsListscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#IsList().() { |
| 650 | lv := target.NewFieldscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#NewField().(field.Descriptorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#Descriptor().()) |
| 651 | list, ok := val.(traitsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/.Listerscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/Lister#) |
| 652 | if !ok { |
| 653 | return unsupportedTypeConversionErrorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/unsupportedTypeConversionError().(field, val) |
| 654 | } |
| 655 | err := msgSetListFieldscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/msgSetListField().(lv.Listscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Value#List().(), field, list) |
| 656 | if err != nil { |
| 657 | return err |
| 658 | } |
| 659 | target.Setscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#Set().(field.Descriptorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#Descriptor().(), lv) |
| 660 | return nil |
| 661 | } |
| 662 | if field.IsMapscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#IsMap().() { |
| 663 | mv := target.NewFieldscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#NewField().(field.Descriptorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#Descriptor().()) |
| 664 | mp, ok := val.(traitsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/.Mapperscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/Mapper#) |
| 665 | if !ok { |
| 666 | return unsupportedTypeConversionErrorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/unsupportedTypeConversionError().(field, val) |
| 667 | } |
| 668 | err := msgSetMapFieldscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/msgSetMapField().(mv.Mapscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Value#Map().(), field, mp) |
| 669 | if err != nil { |
| 670 | return err |
| 671 | } |
| 672 | target.Setscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#Set().(field.Descriptorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#Descriptor().(), mv) |
| 673 | return nil |
| 674 | } |
| 675 | v, err := val.ConvertToNativescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#ConvertToNative.(field.ReflectTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#ReflectType().()) |
| 676 | if err != nil { |
| 677 | return fieldTypeConversionErrorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/fieldTypeConversionError().(field, err) |
| 678 | } |
| 679 | if v == nil { |
| 680 | return nil |
| 681 | } |
| 682 | switch pv := v.(type) { |
| 683 | case protoscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/.Messagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/Message#: |
| 684 | v = pv.ProtoReflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/ProtoMessage#ProtoReflect().() |
| 685 | } |
| 686 | target.Setscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Message#Set().(field.Descriptorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#Descriptor().(), protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.ValueOfscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/ValueOf().(v)) |
| 687 | return nil |
| 688 | } |
| 689 | |
| 690 | func msgSetListFieldscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/msgSetListField().(target protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Listscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/List#, listField *pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.FieldDescriptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#, listVal traitsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/.Listerscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/Lister#) error { |
| 691 | elemReflectType := listField.ReflectTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#ReflectType().().Elemscip-go gomod github.com/golang/go/src go1.23.0 reflect/Type#Elem().() |
| 692 | for i := Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#(0); i < listVal.Sizescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/Sizer#Size.().(Intscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Int#); i++ { |
| 693 | elem := listVal.Getscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/Indexer#Get.(i) |
| 694 | elemVal, err := elem.ConvertToNativescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#ConvertToNative.(elemReflectType) |
| 695 | if err != nil { |
| 696 | return fieldTypeConversionErrorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/fieldTypeConversionError().(listField, err) |
| 697 | } |
| 698 | if elemVal == nil { |
| 699 | continue |
| 700 | } |
| 701 | switch ev := elemVal.(type) { |
| 702 | case protoscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/.Messagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/Message#: |
| 703 | elemVal = ev.ProtoReflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/ProtoMessage#ProtoReflect().() |
| 704 | } |
| 705 | target.Appendscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/List#Append().(protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.ValueOfscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/ValueOf().(elemVal)) |
| 706 | } |
| 707 | return nil |
| 708 | } |
| 709 | |
| 710 | func msgSetMapFieldscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/msgSetMapField().(target protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Mapscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Map#, mapField *pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.FieldDescriptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#, mapVal traitsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/.Mapperscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/Mapper#) error { |
| 711 | targetKeyType := mapField.KeyTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#KeyType..ReflectTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#ReflectType().() |
| 712 | targetValType := mapField.ValueTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#ValueType..ReflectTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#ReflectType().() |
| 713 | it := mapVal.Iteratorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/Iterable#Iterator.() |
| 714 | for it.HasNextscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/Iterator#HasNext.() == Truescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/True. { |
| 715 | key := it.Nextscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/Iterator#Next.() |
| 716 | val := mapVal.Getscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/traits`/Indexer#Get.(key) |
| 717 | k, err := key.ConvertToNativescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#ConvertToNative.(targetKeyType) |
| 718 | if err != nil { |
| 719 | return fieldTypeConversionErrorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/fieldTypeConversionError().(mapField, err) |
| 720 | } |
| 721 | v, err := val.ConvertToNativescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#ConvertToNative.(targetValType) |
| 722 | if err != nil { |
| 723 | return fieldTypeConversionErrorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/fieldTypeConversionError().(mapField, err) |
| 724 | } |
| 725 | if v == nil { |
| 726 | continue |
| 727 | } |
| 728 | switch pv := v.(type) { |
| 729 | case protoscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/.Messagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/Message#: |
| 730 | v = pv.ProtoReflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/ProtoMessage#ProtoReflect().() |
| 731 | } |
| 732 | target.Setscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Map#Set().(protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.ValueOfscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/ValueOf().(k).MapKeyscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Value#MapKey().(), protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.ValueOfscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/ValueOf().(v)) |
| 733 | } |
| 734 | return nil |
| 735 | } |
| 736 | |
| 737 | func unsupportedTypeConversionErrorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/unsupportedTypeConversionError().(field *pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.FieldDescriptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#, val refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/.Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#) error { |
| 738 | msgName := field.Descriptorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#Descriptor().().ContainingMessagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/FieldDescriptor#ContainingMessage().().FullNamescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Descriptor#FullName().() |
| 739 | return fmtscip-go gomod github.com/golang/go/src go1.23.0 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.23.0 fmt/Errorf().("unsupported field type for %v.%v: %v", msgName, field.Namescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#Name().(), val.Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#Type.()) |
| 740 | } |
| 741 | |
| 742 | func fieldTypeConversionErrorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/fieldTypeConversionError().(field *pbscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/.FieldDescriptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#, err error) error { |
| 743 | msgName := field.Descriptorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#Descriptor().().ContainingMessagescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/FieldDescriptor#ContainingMessage().().FullNamescip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Descriptor#FullName().() |
| 744 | return fmtscip-go gomod github.com/golang/go/src go1.23.0 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.23.0 fmt/Errorf().("field type conversion error for %v.%v value type: %v", msgName, field.Namescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/pb`/FieldDescription#Name().(), err) |
| 745 | } |
| 746 | |
| 747 | var ( |
| 748 | // ProtoCELPrimitives provides a map from the protoreflect Kind to the equivalent CEL type. |
| 749 | ProtoCELPrimitivesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/ProtoCELPrimitives. = map[protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Kindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Kind#]*Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#{ |
| 750 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.BoolKindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/BoolKind.: BoolTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/BoolType., |
| 751 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.BytesKindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/BytesKind.: BytesTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/BytesType., |
| 752 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.DoubleKindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/DoubleKind.: DoubleTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/DoubleType., |
| 753 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.FloatKindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/FloatKind.: DoubleTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/DoubleType., |
| 754 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Int32Kindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Int32Kind.: IntTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/IntType., |
| 755 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Int64Kindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Int64Kind.: IntTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/IntType., |
| 756 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Sint32Kindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Sint32Kind.: IntTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/IntType., |
| 757 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Sint64Kindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Sint64Kind.: IntTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/IntType., |
| 758 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Uint32Kindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Uint32Kind.: UintTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UintType., |
| 759 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Uint64Kindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Uint64Kind.: UintTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UintType., |
| 760 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Fixed32Kindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Fixed32Kind.: UintTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UintType., |
| 761 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Fixed64Kindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Fixed64Kind.: UintTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UintType., |
| 762 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Sfixed32Kindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Sfixed32Kind.: IntTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/IntType., |
| 763 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.Sfixed64Kindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/Sfixed64Kind.: IntTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/IntType., |
| 764 | protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/.StringKindscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/StringKind.: StringTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/StringType., |
| 765 | } |
| 766 | ) |