Documentation
¶
Overview ¶
Package plugingen provides multi-language code generation from cleat plugin manifests. It normalizes a plugin.Manifest into an intermediate representation (IR), then feeds it to language-specific generators.
Supported target languages: Go, TypeScript, Python, Rust.
Key types:
- IR — intermediate representation of a plugin's API surface
- HostFuncIR — description of a single host function
- TypeIR — description of a named structured type
Key functions:
- FromManifest — converts a plugin.Manifest into IR
- GenerateGo / GenerateTS / GeneratePython / GenerateRust — code gen
Package plugingen provides intermediate representation and code generation from cleat plugin manifests. It normalizes a plugin.Manifest into an IR that is then fed to language-specific code generators (TypeScript, Python, Rust, Go).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateGo ¶
GenerateGo generates Go source code from the IR.
func GeneratePython ¶
GeneratePython generates Python source code from the IR.
func GenerateRust ¶
GenerateRust generates Rust source code from the IR.
func GenerateTypeScript ¶
GenerateTypeScript generates TypeScript source code from the IR.
Types ¶
type FieldIR ¶
type FieldIR struct {
Name string
Type string // "string", "int64", "float64", "bool", "bytes", "timestamp", "uuid", "array", "map", or a TypeIR name
Optional bool
Description string
Nested *TypeIR // for array<T>, optional<T>, map<K,V>, inline objects
ItemsType string // for array<T> with simple element type
KeyType string // for map<K,V> with simple key type
ValueType string // for map<K,V> with simple value type
}
FieldIR describes a single field within a structured type.
Simple fields set only Type (e.g. "string", "int64", "bool", "bytes", "timestamp", "uuid", or a reference to a named TypeIR).
Array fields set ItemsType for simple element types, or Nested for complex element types (inline objects).
Map fields set KeyType and ValueType for simple key/value types, or Nested for complex value types.
Inline object fields set Nested to a *TypeIR with the embedded fields.
func (FieldIR) IsArrayType ¶
IsArrayType is a method on FieldIR to check if it's an array type.
type HostFuncIR ¶
type HostFuncIR struct {
Name string
Description string
InputType string // name of the type in Types, or a simple type ("string", etc.)
OutputType string // name of the type in Types, or a simple type ("string", etc.)
Idempotent bool
Streaming bool
}
HostFuncIR describes a single host function (workflow-callable plugin method) in the IR.