codegen

package
v0.0.0-...-ba062bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CapnpCodeFilePath    = "capnp/data/data.capnp"
	GoCodeFilePath       = "pkg/_out/functions/functions.go"
	GoCodeVariablePrefix = "p"
)

Variables

This section is empty.

Functions

func CapnpCreateDataFile

func CapnpCreateDataFile(code CapnpCode)

func CapnpDataCodePreamble

func CapnpDataCodePreamble() (code string)

func CapnpFieldDeclaration

func CapnpFieldDeclaration(fieldName string, index int, fieldType grizzly.FieldType, indent int) string

func CapnpStructAggregateRow

func CapnpStructAggregateRow(fields capnp.StructList[grizzly.Field]) (code string)

func CapnpStructEgressRow

func CapnpStructEgressRow(fields capnp.StructList[grizzly.Field]) (code string)

func CapnpStructGroup

func CapnpStructGroup(rootNode *grizzly.Node, fields capnp.StructList[grizzly.Field], fieldNames []string) (code string)

func CapnpStructIngressRow

func CapnpStructIngressRow(rootNode *grizzly.Node, fields capnp.StructList[grizzly.Field]) (code string)

func FindCatalogFieldType

func FindCatalogFieldType(rootNode *grizzly.Node, name string, operatorType grizzly.OperatorType) (typ grizzly.FieldType)

func GoCodeCreateFile

func GoCodeCreateFile(code GoCode)

func GoEval

func GoEval(filterName string, payloadName string, list []string, body string) (code string)

func GoFieldDeclaration

func GoFieldDeclaration(fieldName string, fieldType grizzly.FieldType, fieldUsage grizzly.FieldUsage) (code string)

func GoFieldMapping

func GoFieldMapping(fieldName string, fieldType grizzly.FieldType, fieldUsage grizzly.FieldUsage) (code string)

func GoFilter

func GoFilter(filterName string, payloadName string) (code string)

func GoInternalPayload

func GoInternalPayload(nodeName string, node *grizzly.Node, operatorType grizzly.OperatorType, rootNode *grizzly.Node) (code string)

func GoPassthroughEvalFunction

func GoPassthroughEvalFunction(filterName string, payloadName string) (code string)

func GoTranslate

func GoTranslate(nodeName string, node *grizzly.Node, root *grizzly.Node) (code string)

func GoUnusedInternalPayload

func GoUnusedInternalPayload(name string) (code string)

func Init

func Init()

Types

type CapnpCode

type CapnpCode struct {
	Body string
}

type FilterType

type FilterType int
const (
	IngressFilterType FilterType = iota
	AggregateFilterType
	ProjectFilterType
)

type GoCode

type GoCode struct {
	ExprStack       []GoExpression // Golang snippets to generate a single expression
	Definitions     []string       // Golang code literals definitions
	VariableCounter int

	IngressFilter   goCodeItem
	AggregateFilter goCodeItem
	ProjectFilter   goCodeItem
	SessionOpen     goCodeItem
	SessionClose    goCodeItem
}

type GoExpression

type GoExpression struct {
	Code string
	Kind Kind
}

type Kind

type Kind int
const (
	Boolean Kind = iota
	Duration
	Float
	Integer
	String
	Timestamp
	Variable
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL