Documentation
¶
Index ¶
- Variables
- func MapType(schema []*parser.AST, typeName string, isRepeated bool) (*types.Type, error)
- type Ident
- type TypeProvider
- func (p *TypeProvider) EnumValue(enumName string) ref.Val
- func (p *TypeProvider) FindFieldType(messageType string, fieldName string) (*types.FieldType, bool)
- func (p *TypeProvider) FindIdent(identName string) (ref.Val, bool)
- func (p *TypeProvider) FindStructFieldNames(structType string) ([]string, bool)
- func (p *TypeProvider) FindStructFieldType(structType, fieldName string) (*types.FieldType, bool)
- func (p *TypeProvider) FindStructType(structType string) (*types.Type, bool)
- func (p *TypeProvider) FindType(typeName string) (*expr.Type, bool)
- func (p *TypeProvider) NewValue(typeName string, fields map[string]ref.Val) ref.Val
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ID = cel.OpaqueType(parser.FieldTypeID) Text = cel.OpaqueType(parser.FieldTypeText) Markdown = cel.OpaqueType(parser.FieldTypeMarkdown) Number = cel.OpaqueType(parser.FieldTypeNumber) Decimal = cel.OpaqueType(parser.FieldTypeDecimal) Boolean = cel.OpaqueType(parser.FieldTypeBoolean) Timestamp = cel.OpaqueType(parser.FieldTypeTimestamp) Date = cel.OpaqueType(parser.FieldTypeDate) Duration = cel.OpaqueType(parser.FieldTypeDuration) )
View Source
var ( IDArray = cel.OpaqueType(fmt.Sprintf("%s[]", parser.FieldTypeID)) TextArray = cel.OpaqueType(fmt.Sprintf("%s[]", parser.FieldTypeText)) MarkdownArray = cel.OpaqueType(fmt.Sprintf("%s[]", parser.FieldTypeMarkdown)) NumberArray = cel.OpaqueType(fmt.Sprintf("%s[]", parser.FieldTypeNumber)) DecimalArray = cel.OpaqueType(fmt.Sprintf("%s[]", parser.FieldTypeDecimal)) BooleanArray = cel.OpaqueType(fmt.Sprintf("%s[]", parser.FieldTypeBoolean)) TimestampArray = cel.OpaqueType(fmt.Sprintf("%s[]", parser.FieldTypeTimestamp)) DateArray = cel.OpaqueType(fmt.Sprintf("%s[]", parser.FieldTypeDate)) DurationArray = cel.OpaqueType(fmt.Sprintf("%s[]", parser.FieldTypeDuration)) )
View Source
var ( FunctionSum = "SUM" FunctionCount = "COUNT" FunctionAvg = "AVG" FunctionMedian = "MEDIAN" FunctionMin = "MIN" FunctionMax = "MAX" )
View Source
var (
Role = cel.OpaqueType("_Role")
)
Functions ¶
Types ¶
type TypeProvider ¶
type TypeProvider struct { Schema []*parser.AST // Objects keeps track of complex object types and their fields as defined in the CEL environment, in particular: ctx, headers, secrets. // For example, ctx would look like this: // _Context -> // isAuthenticated -> Bool // now -> Timestamp // identity -> Identity Objects map[string]map[string]*types.Type }
TypeProvider supplies the CEL context with the relevant Keel types and identifiers
func NewTypeProvider ¶
func NewTypeProvider() *TypeProvider
func (*TypeProvider) FindFieldType ¶
func (*TypeProvider) FindStructFieldNames ¶
func (p *TypeProvider) FindStructFieldNames(structType string) ([]string, bool)
func (*TypeProvider) FindStructFieldType ¶
func (p *TypeProvider) FindStructFieldType(structType, fieldName string) (*types.FieldType, bool)
func (*TypeProvider) FindStructType ¶
func (p *TypeProvider) FindStructType(structType string) (*types.Type, bool)
Click to show internal directories.
Click to hide internal directories.