Debian Codegraph @

cel/decls.go

raw symbols SCIP
1 // Copyright 2022 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 celscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/
16
17 import (
18 "fmtscip-go gomod github.com/golang/go/src go1.23.0 fmt/"
19
20 "github.com/google/cel-go/common/astscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/ast`/"
21 "github.com/google/cel-go/common/declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/"
22 "github.com/google/cel-go/common/functionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/"
23 "github.com/google/cel-go/common/typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/"
24 "github.com/google/cel-go/common/types/refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/"
25
26 celpbscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/ "cel.dev/exprscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/"
27 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`/"
28 )
29
30 // Kind indicates a CEL type's kind which is used to differentiate quickly between simple and complex types.
31 type Kindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Kind# = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.Kindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Kind#
32
33 const (
34 // DynKind represents a dynamic type. This kind only exists at type-check time.
35 DynKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/DynKind. Kindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Kind# = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.DynKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/DynKind.
36
37 // AnyKind represents a google.protobuf.Any type. This kind only exists at type-check time.
38 AnyKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/AnyKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.AnyKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/AnyKind.
39
40 // BoolKind represents a boolean type.
41 BoolKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/BoolKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.BoolKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/BoolKind.
42
43 // BytesKind represents a bytes type.
44 BytesKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/BytesKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.BytesKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/BytesKind.
45
46 // DoubleKind represents a double type.
47 DoubleKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/DoubleKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.DoubleKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/DoubleKind.
48
49 // DurationKind represents a CEL duration type.
50 DurationKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/DurationKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.DurationKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/DurationKind.
51
52 // IntKind represents an integer type.
53 IntKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/IntKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.IntKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/IntKind.
54
55 // ListKind represents a list type.
56 ListKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/ListKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.ListKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/ListKind.
57
58 // MapKind represents a map type.
59 MapKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/MapKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.MapKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/MapKind.
60
61 // NullTypeKind represents a null type.
62 NullTypeKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/NullTypeKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.NullTypeKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NullTypeKind.
63
64 // OpaqueKind represents an abstract type which has no accessible fields.
65 OpaqueKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OpaqueKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.OpaqueKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/OpaqueKind.
66
67 // StringKind represents a string type.
68 StringKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/StringKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.StringKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/StringKind.
69
70 // StructKind represents a structured object with typed fields.
71 StructKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/StructKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.StructKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/StructKind.
72
73 // TimestampKind represents a a CEL time type.
74 TimestampKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/TimestampKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.TimestampKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/TimestampKind.
75
76 // TypeKind represents the CEL type.
77 TypeKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/TypeKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.TypeKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/TypeKind.
78
79 // TypeParamKind represents a parameterized type whose type name will be resolved at type-check time, if possible.
80 TypeParamKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/TypeParamKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.TypeParamKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/TypeParamKind.
81
82 // UintKind represents a uint type.
83 UintKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/UintKind. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.UintKindscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UintKind.
84 )
85
86 var (
87 // AnyType represents the google.protobuf.Any type.
88 AnyTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/AnyType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.AnyTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/AnyType.
89 // BoolType represents the bool type.
90 BoolTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/BoolType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.BoolTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/BoolType.
91 // BytesType represents the bytes type.
92 BytesTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/BytesType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.BytesTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/BytesType.
93 // DoubleType represents the double type.
94 DoubleTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/DoubleType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.DoubleTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/DoubleType.
95 // DurationType represents the CEL duration type.
96 DurationTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/DurationType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.DurationTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/DurationType.
97 // DynType represents a dynamic CEL type whose type will be determined at runtime from context.
98 DynTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/DynType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.DynTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/DynType.
99 // IntType represents the int type.
100 IntTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/IntType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.IntTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/IntType.
101 // NullType represents the type of a null value.
102 NullTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/NullType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.NullTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NullType.
103 // StringType represents the string type.
104 StringTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/StringType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.StringTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/StringType.
105 // TimestampType represents the time type.
106 TimestampTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/TimestampType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.TimestampTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/TimestampType.
107 // TypeType represents a CEL type
108 TypeTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/TypeType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.TypeTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/TypeType.
109 // UintType represents a uint type.
110 UintTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/UintType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.UintTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/UintType.
111
112 // function references for instantiating new types.
113
114 // ListType creates an instances of a list type value with the provided element type.
115 ListTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/ListType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.NewListTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewListType().
116 // MapType creates an instance of a map type value with the provided key and value types.
117 MapTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/MapType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.NewMapTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewMapType().
118 // NullableType creates an instance of a nullable type with the provided wrapped type.
119 //
120 // Note: only primitive types are supported as wrapped types.
121 NullableTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/NullableType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.NewNullableTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewNullableType().
122 // OptionalType creates an abstract parameterized type instance corresponding to CEL's notion of optional.
123 OptionalTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OptionalType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.NewOptionalTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewOptionalType().
124 // OpaqueType creates an abstract parameterized type with a given name.
125 OpaqueTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OpaqueType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.NewOpaqueTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewOpaqueType().
126 // ObjectType creates a type references to an externally defined type, e.g. a protobuf message type.
127 ObjectTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/ObjectType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.NewObjectTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewObjectType().
128 // TypeParamType creates a parameterized type instance.
129 TypeParamTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/TypeParamType. = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.NewTypeParamTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/NewTypeParamType().
130 )
131
132 // Type holds a reference to a runtime type with an optional type-checked set of type parameters.
133 type Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Type# = typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/Type#
134
135 // Constant creates an instances of an identifier declaration with a variable name, type, and value.
136 func Constantscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Constant().(name string, t *Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Type#, v 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#) EnvOptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/EnvOption# {
137 return func(e *Envscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#) (*Envscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#, error) {
138 e.variablesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#variables. = append(e.variablesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#variables., declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.NewConstantscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/NewConstant().(name, t, v))
139 return e, nil
140 }
141 }
142
143 // Variable creates an instance of a variable declaration with a variable name and type.
144 func Variablescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Variable().(name string, t *Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Type#) EnvOptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/EnvOption# {
145 return VariableWithDocscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/VariableWithDoc().(name, t, "")
146 }
147
148 // VariableWithDoc creates an instance of a variable declaration with a variable name, type, and doc string.
149 func VariableWithDocscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/VariableWithDoc().(name string, t *Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Type#, doc string) EnvOptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/EnvOption# {
150 return func(e *Envscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#) (*Envscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#, error) {
151 e.variablesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#variables. = append(e.variablesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#variables., declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.NewVariableWithDocscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/NewVariableWithDoc().(name, t, doc))
152 return e, nil
153 }
154 }
155
156 // VariableDecls configures a set of fully defined cel.VariableDecl instances in the environment.
157 func VariableDeclsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/VariableDecls().(vars ...*declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.VariableDeclscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/VariableDecl#) EnvOptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/EnvOption# {
158 return func(e *Envscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#) (*Envscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#, error) {
159 for _, v := range vars {
160 e.variablesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#variables. = append(e.variablesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#variables., v)
161 }
162 return e, nil
163 }
164 }
165
166 // Function defines a function and overloads with optional singleton or per-overload bindings.
167 //
168 // Using Function is roughly equivalent to calling Declarations() to declare the function signatures
169 // and Functions() to define the function bindings, if they have been defined. Specifying the
170 // same function name more than once will result in the aggregation of the function overloads. If any
171 // signatures conflict between the existing and new function definition an error will be raised.
172 // However, if the signatures are identical and the overload ids are the same, the redefinition will
173 // be considered a no-op.
174 //
175 // One key difference with using Function() is that each FunctionDecl provided will handle dynamic
176 // dispatch based on the type-signatures of the overloads provided which means overload resolution at
177 // runtime is handled out of the box rather than via a custom binding for overload resolution via
178 // Functions():
179 //
180 // - Overloads are searched in the order they are declared
181 // - Dynamic dispatch for lists and maps is limited by inspection of the list and map contents
182 //
183 // at runtime. Empty lists and maps will result in a 'default dispatch'
184 //
185 // - In the event that a default dispatch occurs, the first overload provided is the one invoked
186 //
187 // If you intend to use overloads which differentiate based on the key or element type of a list or
188 // map, consider using a generic function instead: e.g. func(list(T)) or func(map(K, V)) as this
189 // will allow your implementation to determine how best to handle dispatch and the default behavior
190 // for empty lists and maps whose contents cannot be inspected.
191 //
192 // For functions which use parameterized opaque types (abstract types), consider using a singleton
193 // function which is capable of inspecting the contents of the type and resolving the appropriate
194 // overload as CEL can only make inferences by type-name regarding such types.
195 func Functionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Function().(name string, opts ...FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt#) EnvOptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/EnvOption# {
196 return func(e *Envscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#) (*Envscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#, error) {
197 fn, err := declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.NewFunctionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/NewFunction().(name, opts...)
198 if err != nil {
199 return nil, err
200 }
201 return FunctionDeclsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionDecls().(fn)(e)
202 }
203 }
204
205 // OverloadSelector selects an overload associated with a given function when it returns true.
206 //
207 // Used in combination with the FunctionDecl.Subset method.
208 type OverloadSelectorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadSelector# = declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.OverloadSelectorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/OverloadSelector#
209
210 // IncludeOverloads defines an OverloadSelector which allow-lists a set of overloads by their ids.
211 func IncludeOverloadsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/IncludeOverloads().(overloadIDs ...string) OverloadSelectorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadSelector# {
212 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.IncludeOverloadsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/IncludeOverloads().(overloadIDs...)
213 }
214
215 // ExcludeOverloads defines an OverloadSelector which deny-lists a set of overloads by their ids.
216 func ExcludeOverloadsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/ExcludeOverloads().(overloadIDs ...string) OverloadSelectorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadSelector# {
217 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.ExcludeOverloadsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/ExcludeOverloads().(overloadIDs...)
218 }
219
220 // FunctionDecls provides one or more fully formed function declarations to be added to the environment.
221 func FunctionDeclsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionDecls().(funcs ...*declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.FunctionDeclscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/FunctionDecl#) EnvOptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/EnvOption# {
222 return func(e *Envscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#) (*Envscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#, error) {
223 var err error
224 for _, fn := range funcs {
225 if existing, found := e.functionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#functions.[fn.Namescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/FunctionDecl#Name().()]; found {
226 fn, err = existing.Mergescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/FunctionDecl#Merge().(fn)
227 if err != nil {
228 return nil, err
229 }
230 }
231 e.functionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Env#functions.[fn.Namescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/FunctionDecl#Name().()] = fn
232 }
233 return e, nil
234 }
235 }
236
237 // FunctionOpt defines a functional option for configuring a function declaration.
238 type FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt# = declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/FunctionOpt#
239
240 // FunctionDocs provides a general usage documentation for the function.
241 //
242 // Use OverloadExamples to provide example usage instructions for specific overloads.
243 func FunctionDocsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionDocs().(docs ...string) FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt# {
244 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.FunctionDocsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/FunctionDocs().(docs...)
245 }
246
247 // SingletonUnaryBinding creates a singleton function definition to be used for all function overloads.
248 //
249 // Note, this approach works well if operand is expected to have a specific trait which it implements,
250 // e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings.
251 func SingletonUnaryBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/SingletonUnaryBinding().(fn functionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/.UnaryOpscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/UnaryOp#, traits ...int) FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt# {
252 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.SingletonUnaryBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/SingletonUnaryBinding().(fn, traits...)
253 }
254
255 // SingletonBinaryImpl creates a singleton function definition to be used with all function overloads.
256 //
257 // Note, this approach works well if operand is expected to have a specific trait which it implements,
258 // e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings.
259 //
260 // Deprecated: use SingletonBinaryBinding
261 func SingletonBinaryImplscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/SingletonBinaryImpl().(fn functionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/.BinaryOpscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/BinaryOp#, traits ...int) FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt# {
262 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.SingletonBinaryBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/SingletonBinaryBinding().(fn, traits...)
263 }
264
265 // SingletonBinaryBinding creates a singleton function definition to be used with all function overloads.
266 //
267 // Note, this approach works well if operand is expected to have a specific trait which it implements,
268 // e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings.
269 func SingletonBinaryBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/SingletonBinaryBinding().(fn functionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/.BinaryOpscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/BinaryOp#, traits ...int) FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt# {
270 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.SingletonBinaryBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/SingletonBinaryBinding().(fn, traits...)
271 }
272
273 // SingletonFunctionImpl creates a singleton function definition to be used with all function overloads.
274 //
275 // Note, this approach works well if operand is expected to have a specific trait which it implements,
276 // e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings.
277 //
278 // Deprecated: use SingletonFunctionBinding
279 func SingletonFunctionImplscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/SingletonFunctionImpl().(fn functionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/.FunctionOpscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/FunctionOp#, traits ...int) FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt# {
280 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.SingletonFunctionBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/SingletonFunctionBinding().(fn, traits...)
281 }
282
283 // SingletonFunctionBinding creates a singleton function definition to be used with all function overloads.
284 //
285 // Note, this approach works well if operand is expected to have a specific trait which it implements,
286 // e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings.
287 func SingletonFunctionBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/SingletonFunctionBinding().(fn functionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/.FunctionOpscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/FunctionOp#, traits ...int) FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt# {
288 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.SingletonFunctionBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/SingletonFunctionBinding().(fn, traits...)
289 }
290
291 // DisableDeclaration disables the function signatures, effectively removing them from the type-check
292 // environment while preserving the runtime bindings.
293 func DisableDeclarationscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/DisableDeclaration().(value bool) FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt# {
294 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.DisableDeclarationscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/DisableDeclaration().(value)
295 }
296
297 // Overload defines a new global overload with an overload id, argument types, and result type. Through the
298 // use of OverloadOpt options, the overload may also be configured with a binding, an operand trait, and to
299 // be non-strict.
300 //
301 // Note: function bindings should be commonly configured with Overload instances whereas operand traits and
302 // strict-ness should be rare occurrences.
303 func Overloadscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Overload().(overloadID string, args []*Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Type#, resultType *Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Type#, opts ...OverloadOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadOpt#) FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt# {
304 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.Overloadscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/Overload().(overloadID, args, resultType, opts...)
305 }
306
307 // MemberOverload defines a new receiver-style overload (or member function) with an overload id, argument types,
308 // and result type. Through the use of OverloadOpt options, the overload may also be configured with a binding,
309 // an operand trait, and to be non-strict.
310 //
311 // Note: function bindings should be commonly configured with Overload instances whereas operand traits and
312 // strict-ness should be rare occurrences.
313 func MemberOverloadscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/MemberOverload().(overloadID string, args []*Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Type#, resultType *Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Type#, opts ...OverloadOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadOpt#) FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt# {
314 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.MemberOverloadscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/MemberOverload().(overloadID, args, resultType, opts...)
315 }
316
317 // OverloadOpt is a functional option for configuring a function overload.
318 type OverloadOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadOpt# = declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.OverloadOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/OverloadOpt#
319
320 // OverloadExamples configures an example of how to invoke the overload.
321 func OverloadExamplesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadExamples().(docs ...string) OverloadOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadOpt# {
322 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.OverloadExamplesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/OverloadExamples().(docs...)
323 }
324
325 // UnaryBinding provides the implementation of a unary overload. The provided function is protected by a runtime
326 // type-guard which ensures runtime type agreement between the overload signature and runtime argument types.
327 func UnaryBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/UnaryBinding().(binding functionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/.UnaryOpscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/UnaryOp#) OverloadOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadOpt# {
328 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.UnaryBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/UnaryBinding().(binding)
329 }
330
331 // BinaryBinding provides the implementation of a binary overload. The provided function is protected by a runtime
332 // type-guard which ensures runtime type agreement between the overload signature and runtime argument types.
333 func BinaryBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/BinaryBinding().(binding functionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/.BinaryOpscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/BinaryOp#) OverloadOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadOpt# {
334 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.BinaryBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/BinaryBinding().(binding)
335 }
336
337 // FunctionBinding provides the implementation of a variadic overload. The provided function is protected by a runtime
338 // type-guard which ensures runtime type agreement between the overload signature and runtime argument types.
339 func FunctionBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionBinding().(binding functionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/.FunctionOpscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/functions`/FunctionOp#) OverloadOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadOpt# {
340 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.FunctionBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/FunctionBinding().(binding)
341 }
342
343 // LateFunctionBinding indicates that the function has a binding which is not known at compile time.
344 // This is useful for functions which have side-effects or are not deterministically computable.
345 func LateFunctionBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/LateFunctionBinding().() OverloadOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadOpt# {
346 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.LateFunctionBindingscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/LateFunctionBinding().()
347 }
348
349 // OverloadIsNonStrict enables the function to be called with error and unknown argument values.
350 //
351 // Note: do not use this option unless absoluately necessary as it should be an uncommon feature.
352 func OverloadIsNonStrictscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadIsNonStrict().() OverloadOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadOpt# {
353 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.OverloadIsNonStrictscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/OverloadIsNonStrict().()
354 }
355
356 // OverloadOperandTrait configures a set of traits which the first argument to the overload must implement in order to be
357 // successfully invoked.
358 func OverloadOperandTraitscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadOperandTrait().(trait int) OverloadOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/OverloadOpt# {
359 return declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.OverloadOperandTraitscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/OverloadOperandTrait().(trait)
360 }
361
362 // TypeToExprType converts a CEL-native type representation to a protobuf CEL Type representation.
363 func TypeToExprTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/TypeToExprType().(t *Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/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#, error) {
364 return typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.TypeToExprTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/TypeToExprType().(t)
365 }
366
367 // ExprTypeToType converts a protobuf CEL type representation to a CEL-native type representation.
368 func ExprTypeToTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/ExprTypeToType().(t *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#) (*Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Type#, error) {
369 return typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.ExprTypeToTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/ExprTypeToType().(t)
370 }
371
372 // ExprDeclToDeclaration converts a protobuf CEL declaration to a CEL-native declaration, either a Variable or Function.
373 func ExprDeclToDeclarationscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/ExprDeclToDeclaration().(d *exprpbscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/.Declscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/Decl#) (EnvOptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/EnvOption#, error) {
374 return AlphaProtoAsDeclarationscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/AlphaProtoAsDeclaration().(d)
375 }
376
377 // AlphaProtoAsDeclaration converts a v1alpha1.Decl value describing a variable or function into an EnvOption.
378 func AlphaProtoAsDeclarationscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/AlphaProtoAsDeclaration().(d *exprpbscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/.Declscip-go gomod google.golang.org/genproto/googleapis/api f6391c0de4c7 `google.golang.org/genproto/googleapis/api/expr/v1alpha1`/Decl#) (EnvOptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/EnvOption#, error) {
379 canonical := &celpbscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/.Declscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl#{}
380 if err := convertProtoscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/convertProto().(d, canonical); err != nil {
381 return nil, err
382 }
383 return ProtoAsDeclarationscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/ProtoAsDeclaration().(canonical)
384 }
385
386 // ProtoAsDeclaration converts a canonical celpb.Decl value describing a variable or function into an EnvOption.
387 func ProtoAsDeclarationscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/ProtoAsDeclaration().(d *celpbscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/.Declscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl#) (EnvOptionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/EnvOption#, error) {
388 switch d.GetDeclKindscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl#GetDeclKind().().(type) {
389 case *celpbscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/.Decl_Functionscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_Function#:
390 overloads := d.GetFunctionscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl#GetFunction().().GetOverloadsscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_FunctionDecl#GetOverloads().()
391 opts := make([]FunctionOptscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/FunctionOpt#, len(overloads))
392 for i, o := range overloads {
393 args := make([]*Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Type#, len(o.GetParamsscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_FunctionDecl_Overload#GetParams().()))
394 for j, p := range o.GetParamsscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_FunctionDecl_Overload#GetParams().() {
395 a, err := typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.ProtoAsTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/ProtoAsType().(p)
396 if err != nil {
397 return nil, err
398 }
399 args[j] = a
400 }
401 res, err := typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.ProtoAsTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/ProtoAsType().(o.GetResultTypescip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_FunctionDecl_Overload#GetResultType().())
402 if err != nil {
403 return nil, err
404 }
405 if o.IsInstanceFunctionscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_FunctionDecl_Overload#IsInstanceFunction. {
406 opts[i] = declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.MemberOverloadscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/MemberOverload().(o.GetOverloadIdscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_FunctionDecl_Overload#GetOverloadId().(), args, res)
407 } else {
408 opts[i] = declsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/.Overloadscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/decls`/Overload().(o.GetOverloadIdscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_FunctionDecl_Overload#GetOverloadId().(), args, res)
409 }
410 }
411 return Functionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Function().(d.GetNamescip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl#GetName().(), opts...), nil
412 case *celpbscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/.Decl_Identscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_Ident#:
413 t, err := typesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/.ProtoAsTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types`/ProtoAsType().(d.GetIdentscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl#GetIdent().().GetTypescip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_IdentDecl#GetType().())
414 if err != nil {
415 return nil, err
416 }
417 if d.GetIdentscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl#GetIdent().().GetValuescip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_IdentDecl#GetValue().() == nil {
418 return Variablescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Variable().(d.GetNamescip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl#GetName().(), t), nil
419 }
420 val, err := astscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/ast`/.ProtoConstantAsValscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/ast`/ProtoConstantAsVal().(d.GetIdentscip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl#GetIdent().().GetValuescip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl_IdentDecl#GetValue().())
421 if err != nil {
422 return nil, err
423 }
424 return Constantscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/cel`/Constant().(d.GetNamescip-go gomod cel.dev/expr v0.25.1 `cel.dev/expr`/Decl#GetName().(), t, val), nil
425 default:
426 return nil, 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 decl: %v", d)
427 }
428 }