Documentation
¶
Overview ¶
Package model emits the same-package descriptor bootstrap used by generated Golem model code. Emission is deliberately in-memory so callers can pass the returned files directly to go/packages through an Overlay.
Index ¶
Constants ¶
const ( // DefaultGolemImportPath is the public package imported by generated source. DefaultGolemImportPath = "github.com/eleven-am/golem/go/golem" // BootstrapFilename is the stable filename used for every emitted package. BootstrapFilename = "zz_golem_bootstrap.go" // FinalFilename is the manifest-owned descriptor file emitted after typed discovery. FinalFilename = "zz_golem_models.gen.go" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FinalStamp ¶
type Manifest ¶
type Manifest struct {
Symbols []Symbol
}
Manifest is sorted by package, namespace, name, and kind.
type PackageSpec ¶
PackageSpec supplies the Go package information that is intentionally absent from the canonical compiler IR. Directory may be empty when callers only need source; set it when Result.Overlay will be passed to go/packages.
type Request ¶
type Request struct {
Compilation ir.CompilationIR
Packages []PackageSpec
GolemImportPath string
FinalStamp *FinalStamp
}
Request describes one deterministic bootstrap emission.
type Result ¶
Result contains generated files and their stable symbol map.
type Symbol ¶
type Symbol struct {
PackagePath string
Namespace string
Name string
Kind SymbolKind
ModelID ir.ModelID
FieldID ir.FieldID
RelationID ir.RelationID
KeyID ir.KeyID
Fields []ir.FieldID
}
Symbol maps a generated Go symbol back to the canonical stable identifier consumed by later typed interpretation. Namespace is empty for package-level symbols; Name is the member name for namespace fields.
type SymbolKind ¶
type SymbolKind string
SymbolKind classifies a generated public symbol.
const ( SymbolModelDescriptor SymbolKind = "model_descriptor" SymbolNamespace SymbolKind = "namespace" SymbolField SymbolKind = "field" SymbolRelation SymbolKind = "relation" SymbolSelector SymbolKind = "selector" )