MCPcopy Create free account
hub / github.com/cel-expr/cel-go / getExtFieldName

Function getExtFieldName

ext/protos.go:129–140  ·  view source on GitHub ↗
(mef cel.MacroExprFactory, expr ast.Expr)

Source from the content-addressed store, hash-verified

127}
128
129func getExtFieldName(mef cel.MacroExprFactory, expr ast.Expr) (string, *cel.Error) {
130 isValid := false
131 extensionField := ""
132 switch expr.Kind() {
133 case ast.SelectKind:
134 extensionField, isValid = validateIdentifier(expr)
135 }
136 if !isValid {
137 return "", mef.NewError(expr.ID(), "invalid extension field")
138 }
139 return extensionField, nil
140}
141
142func validateIdentifier(expr ast.Expr) (string, bool) {
143 switch expr.Kind() {

Callers 2

hasProtoExtFunction · 0.85
getProtoExtFunction · 0.85

Calls 4

validateIdentifierFunction · 0.85
KindMethod · 0.65
NewErrorMethod · 0.65
IDMethod · 0.65

Tested by

no test coverage detected