Documentation ¶
Index ¶
- Variables
- type Hierarchy
- func (h Hierarchy) ConvertToNative(typeDesc reflect.Type) (any, error)
- func (h Hierarchy) ConvertToType(typeVal ref.Type) ref.Val
- func (h Hierarchy) Equal(other ref.Val) ref.Val
- func (h Hierarchy) Get(index ref.Val) ref.Val
- func (h Hierarchy) Receive(function, _ string, args []ref.Val) ref.Val
- func (h Hierarchy) Size() ref.Val
- func (h Hierarchy) Type() ref.Type
- func (h Hierarchy) Value() any
- type JSONFieldProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HierarchyType = cel.ObjectType(hierarchyTypeName, traits.IndexerType, traits.SizerType, traits.ReceiverType) HierarchyFunc = cel.Function(hierarchyFn, cel.Overload( fmt.Sprintf("%s_string", hierarchyFn), []*cel.Type{cel.StringType}, hierarchyCelType, cel.UnaryBinding(unaryHierarchyFnImpl), ), cel.Overload( fmt.Sprintf("%s_string_string", hierarchyFn), []*cel.Type{cel.StringType, cel.StringType}, hierarchyCelType, cel.BinaryBinding(binaryHierarchyFnImpl), ), cel.Overload( fmt.Sprintf("%s_stringarray", hierarchyFn), []*cel.Type{cel.ListType(cel.StringType)}, hierarchyCelType, cel.UnaryBinding(unaryHierarchyFnImpl), ), ) HierarchyDeclrations = []*exprpb.Decl{ decls.NewFunction(overloadAncestorOf, decls.NewInstanceOverload(overloadAncestorOf, []*exprpb.Type{hierarchyTypeExpr, hierarchyTypeExpr}, decls.Bool, ), ), decls.NewFunction(overloadCommonAncestors, decls.NewInstanceOverload(overloadCommonAncestors, []*exprpb.Type{hierarchyTypeExpr, hierarchyTypeExpr}, hierarchyTypeExpr, ), ), decls.NewFunction(overloadDescendentOf, decls.NewInstanceOverload(overloadDescendentOf, []*exprpb.Type{hierarchyTypeExpr, hierarchyTypeExpr}, decls.Bool, ), ), decls.NewFunction(overloadImmediateChildOf, decls.NewInstanceOverload(overloadImmediateChildOf, []*exprpb.Type{hierarchyTypeExpr, hierarchyTypeExpr}, decls.Bool, ), ), decls.NewFunction(overloadImmediateParentOf, decls.NewInstanceOverload(overloadImmediateParentOf, []*exprpb.Type{hierarchyTypeExpr, hierarchyTypeExpr}, decls.Bool, ), ), decls.NewFunction(overloadOverlaps, decls.NewInstanceOverload(overloadOverlaps, []*exprpb.Type{hierarchyTypeExpr, hierarchyTypeExpr}, decls.Bool, ), ), decls.NewFunction(overloadSiblingOf, decls.NewInstanceOverload(overloadSiblingOf, []*exprpb.Type{hierarchyTypeExpr, hierarchyTypeExpr}, decls.Bool, ), ), decls.NewFunction(overloads.Size, decls.NewInstanceOverload(fmt.Sprintf("%s_size", hierarchyFn), []*exprpb.Type{hierarchyTypeExpr}, decls.Int, ), ), decls.NewFunction(operators.Index, decls.NewOverload(fmt.Sprintf("%s_index", hierarchyFn), []*exprpb.Type{hierarchyTypeExpr, decls.Int}, decls.String, ), ), } )
Functions ¶
This section is empty.
Types ¶
type Hierarchy ¶
type Hierarchy []string
Hierarchy is a type that represents a dot-separated hierarchy such as a.b.c.d.
func (Hierarchy) ConvertToNative ¶
ConvertToNative implements ref.Val.ConvertToNative.
func (Hierarchy) ConvertToType ¶
ConvertToType implements ref.Val.ConvertToType.
type JSONFieldProvider ¶ added in v0.13.0
JSONFieldProvider is a custom type provider that allows protobuf fields to be accessed by their JSON name (camel case).
func NewCamelCaseFieldProvider ¶ added in v0.13.0
func NewCamelCaseFieldProvider(tp types.Provider) *JSONFieldProvider
func (*JSONFieldProvider) FindStructFieldType ¶ added in v0.30.0
func (ccfp *JSONFieldProvider) FindStructFieldType(msgType, fieldName string) (*types.FieldType, bool)
Click to show internal directories.
Click to hide internal directories.