Debian Codegraph @

common/types/ref/provider.go

raw symbols SCIP
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 refscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/
16
17 import (
18 "google.golang.org/protobuf/protoscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/proto`/"
19 "google.golang.org/protobuf/reflect/protoreflectscip-go gomod google.golang.org/protobuf v1.36.10 `google.golang.org/protobuf/reflect/protoreflect`/"
20
21 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`/"
22 )
23
24 // TypeProvider specifies functions for creating new object instances and for
25 // resolving enum values by name.
26 //
27 // Deprecated: use types.Provider
28 type TypeProviderscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeProvider# interface {
29 // EnumValue returns the numeric value of the given enum value name.
30 EnumValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeProvider#EnumValue.(enumName string) Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#
31
32 // FindIdent takes a qualified identifier name and returns a Value if one exists.
33 FindIdentscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeProvider#FindIdent.(identName string) (Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#, bool)
34
35 // FindType looks up the Type given a qualified typeName. Returns false if not found.
36 FindTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeProvider#FindType.(typeName 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)
37
38 // FieldFieldType returns the field type for a checked type value. Returns false if
39 // the field could not be found.
40 FindFieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeProvider#FindFieldType.(messageType, fieldName string) (*FieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldType#, bool)
41
42 // NewValue creates a new type value from a qualified name and map of field name
43 // to value.
44 //
45 // Note, for each value, the Val.ConvertToNative function will be invoked to convert
46 // the Val to the field's native type. If an error occurs during conversion, the
47 // NewValue will be a types.Err.
48 NewValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeProvider#NewValue.(typeName string, fields map[string]Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#) Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#
49 }
50
51 // TypeAdapter converts native Go values of varying type and complexity to equivalent CEL values.
52 //
53 // Deprecated: use types.Adapter
54 type TypeAdapterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeAdapter# interface {
55 // NativeToValue converts the input `value` to a CEL `ref.Val`.
56 NativeToValuescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeAdapter#NativeToValue.(value any) Valscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Val#
57 }
58
59 // TypeRegistry allows third-parties to add custom types to CEL. Not all `TypeProvider`
60 // implementations support type-customization, so these features are optional. However, a
61 // `TypeRegistry` should be a `TypeProvider` and a `TypeAdapter` to ensure that types
62 // which are registered can be converted to CEL representations.
63 //
64 // Deprecated: use types.Registry
65 type TypeRegistryscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeRegistry# interface {
66 TypeAdapterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeAdapter#
67 TypeProviderscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeProvider#
68
69 // RegisterDescriptor registers the contents of a protocol buffer `FileDescriptor`.
70 RegisterDescriptorscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeRegistry#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
71
72 // RegisterMessage registers a protocol buffer message and its dependencies.
73 RegisterMessagescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeRegistry#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
74
75 // RegisterType registers a type value with the provider which ensures the
76 // provider is aware of how to map the type to an identifier.
77 //
78 // If a type is provided more than once with an alternative definition, the
79 // call will result in an error.
80 RegisterTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/TypeRegistry#RegisterType.(types ...Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/Type#) error
81 }
82
83 // FieldType represents a field's type value and whether that field supports
84 // presence detection.
85 //
86 // Deprecated: use types.FieldType
87 type FieldTypescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldType# struct {
88 // Type of the field as a protobuf type value.
89 Typescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldType#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#
90
91 // IsSet indicates whether the field is set on an input object.
92 IsSetscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldType#IsSet. FieldTesterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldTester#
93
94 // GetFrom retrieves the field value on the input object, if set.
95 GetFromscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldType#GetFrom. FieldGetterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldGetter#
96 }
97
98 // FieldTester is used to test field presence on an input object.
99 type FieldTesterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldTester# func(target any) bool
100
101 // FieldGetter is used to get the field value from an input object, if set.
102 type FieldGetterscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/types/ref`/FieldGetter# func(target any) (any, error)