Documentation
¶
Overview ¶
Package golang lowers semantic handler transcription plans into Go AST.
Index ¶
- func ScaffoldHooks(config Config) (*ast.File, error)
- func ValidateUniversalWriterPlan(value *plan.Plan, config Config) error
- type Asset
- type Config
- type EntityAsset
- type EntityAssociation
- type EntityInvariant
- type EntityMethod
- type MutationActionAsset
- type MutationFrameAsset
- type MutationFrameLayout
- type MutationFrameRole
- type MutationHookAsset
- type MutationHookRole
- type MutationInvariantAsset
- type MutationOutputAsset
- type MutationPreviousAsset
- type MutationPreviousRole
- type MutationProgramAsset
- type MutationScaffold
- type MutationScaffoldBinding
- type MutationValidationAsset
- type ReadIndexAsset
- type ReadIndexConfig
- type RecordType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ScaffoldHooks ¶
ScaffoldHooks creates the optional user-owned input/output lifecycle file. The generator persists it create-once and never adds it to its manifest.
Types ¶
type Asset ¶
type Asset struct {
Factory string
Handler string
File *ast.File
Entities *EntityAsset
}
Asset is the isolated Go AST product of one target lowering pass.
type Config ¶
type Config struct {
ReadIndexes *ReadIndexConfig
Package string
// PackagePath is the canonical target import path when lowering hook type references.
PackagePath string
Factory string
Handler string
InputType string
OutputType string
Records []RecordType
Imports []spec.ImportSpec
}
Config contains target syntax and package choices only.
type EntityAsset ¶
type EntityAsset struct {
File *ast.File
CaptureFunction string
Methods []EntityMethod
SnapshotType string
SyncContextType string
SyncMethod string
Associations []EntityAssociation
Invariants []EntityInvariant
// contains filtered or unexported fields
}
func EntitySupport ¶
func EntitySupport(value *plan.Plan, config Config) (*EntityAsset, error)
EntitySupport emits typed original-state and setter AST for both targets.
type EntityAssociation ¶
type EntityInvariant ¶
EntityInvariant names generated backfill support for one canonical role/group.
type EntityMethod ¶
EntityMethod records generated public methods for authored-source ownership checks.
type MutationActionAsset ¶
MutationActionAsset is typed policy lowering, never a transaction owner.
func MutationActionSupport ¶
func MutationActionSupport(value *plan.Plan, config Config, entities *EntityAsset, frames *MutationFrameAsset) (*MutationActionAsset, error)
type MutationFrameAsset ¶
type MutationFrameAsset struct {
File *ast.File
Layout *MutationFrameLayout
Previous *MutationPreviousAsset
TypeName, CaptureFunction, BuildMethod string
VerifyMethod string
}
MutationFrameAsset composes capture and frame preparation from the same immutable record plan. The caller captures Current before input initialization.
func MutationFrameSupport ¶
func MutationFrameSupport(value *plan.Plan, config Config, entities *EntityAsset) (*MutationFrameAsset, error)
type MutationFrameLayout ¶
type MutationFrameLayout struct {
File *ast.File
TypeName string
Roles []MutationFrameRole
OrderField, OrderEntryType string
}
MutationFrameLayout is the sole declaration owner for typed entity frames, including roles without hooks that still need invariants or database state.
func MutationFrames ¶
func MutationFrames(value *plan.Plan, config Config) (*MutationFrameLayout, error)
type MutationFrameRole ¶
type MutationFrameRole struct {
Identity string
Path plan.FieldPath
FrameType, Field, EntityType, ParentType string
}
MutationFrameRole references one existing semantic role using target names. It does not define another relation or mutation policy tree.
type MutationHookAsset ¶
type MutationHookAsset struct {
File *ast.File
TypeName, FramesType string
Roles []MutationHookRole
}
MutationHookAsset is a partial generated product. Its declarations/imports compose into the existing handler artifact; it does not implement Program.
func MutationHookSupport ¶
func MutationHookSupport(value *plan.Plan, config Config, supplied ...*MutationFrameLayout) (*MutationHookAsset, error)
MutationHookSupport lowers only dependency preparation and typed Init/Validate calls. The surrounding Program owns matching/current projection and populates frames with distinct DB Previous/PreviousFields and captured OriginalPresence.
type MutationHookRole ¶
MutationHookRole names a typed target-language frame, not a second policy tree.
type MutationInvariantAsset ¶
MutationInvariantAsset applies declared groups to the shared typed frames. It is a phase product, not a separate execution engine or complete Program.
func MutationInvariantSupport ¶
func MutationInvariantSupport(value *plan.Plan, config Config, entities *EntityAsset, layout *MutationFrameLayout) (*MutationInvariantAsset, error)
type MutationOutputAsset ¶
MutationOutputAsset projects the working request body into the declared output contract. Call before returning output, not from the error-free getter.
func MutationOutputSupport ¶
func MutationOutputSupport(value *plan.Plan, config Config) (*MutationOutputAsset, error)
type MutationPreviousAsset ¶
type MutationPreviousAsset struct {
File *ast.File
Roles []MutationPreviousRole
}
MutationPreviousAsset freezes read rows and their actual projection evidence. It is a phase product, not an implementation of the generic Program contract.
func MutationPreviousSupport ¶
func MutationPreviousSupport(value *plan.Plan, config Config, entities *EntityAsset) (*MutationPreviousAsset, error)
type MutationPreviousRole ¶
type MutationPreviousRole struct {
Identity string
Path plan.FieldPath
TypeName, CaptureFunction, EntryType string
}
MutationPreviousRole describes a generated typed database snapshot product. Its identity index is deliberately separate from processing associations.
type MutationProgramAsset ¶
type MutationProgramAsset struct {
File *ast.File
Factory, Definition, Program string
Indexes *ReadIndexAsset
Entities *EntityAsset
Frames *MutationFrameAsset
Hooks *MutationHookAsset
Invariants *MutationInvariantAsset
Actions *MutationActionAsset
Validation *MutationValidationAsset
Output *MutationOutputAsset
}
MutationProgramAsset assembles real policy phases. Support products remain separate source files in the same package; transaction completion stays in the canonical runtime adapter/engine.
func MutationProgram ¶
func MutationProgram(value *plan.Plan, config Config) (*MutationProgramAsset, error)
type MutationScaffold ¶
type MutationScaffold struct {
File *ast.File
Plan *plan.Plan
Bindings []MutationScaffoldBinding
}
MutationScaffold is a target proposal over a detached semantic plan. Bindings identify only newly proposed hook types; authored hooks retain their authority.
func ScaffoldMutationHooks ¶
func ScaffoldMutationHooks(value *plan.Plan, config Config) (*MutationScaffold, error)
ScaffoldMutationHooks proposes invocation-scoped EntityHooks, never methods on the input/output contracts or foreign entity types. Self descendants use the same role's LifecycleContext, including its typed SelfParent field and the invocation-owned component Output.
type MutationScaffoldBinding ¶
type MutationValidationAsset ¶
MutationValidationAsset validates every typed frame before custom Validate hooks. It shares action selection with diff and consumes native scoped checks.
func MutationValidationSupport ¶
func MutationValidationSupport(value *plan.Plan, config Config, entities *EntityAsset, frames *MutationFrameAsset) (*MutationValidationAsset, error)
type ReadIndexAsset ¶
type ReadIndexAsset struct {
File *ast.File
TypeName, BuildFunction string
PackagePath string
CacheField string
}
ReadIndexAsset is application lookup syntax, separate from Previous authority.
func ReadIndexes ¶
func ReadIndexes(value *plan.Plan, config Config) (*ReadIndexAsset, error)
ReadIndexes emits only the public typed read-index support used by input and entity hooks. It does not emit a component-specific mutation program.
type ReadIndexConfig ¶
type ReadIndexConfig struct {
Types xshape.Lookup
Package, PackagePath, InputType string
Owned bool
}
ReadIndexConfig selects the input's package authority for application helpers.
type RecordType ¶
type RecordType struct {
Identity string
Path plan.FieldPath
Value string
Current string
// CurrentValue is the input-bound read carrier; Current names its row collection.
// Empty means the existing direct-current collection contract.
CurrentValue string
}
RecordType supplies target-language types after final contract and view authority resolution. Semantic plans remain target-neutral.
Source Files
¶
- ast_helpers.go
- entity.go
- entity_access_plan.go
- entity_accessors.go
- entity_baseline.go
- entity_capture.go
- entity_clone.go
- entity_invariant_backfill.go
- entity_invariants.go
- entity_lookup.go
- entity_lookup_parent.go
- entity_marker_patch.go
- entity_match.go
- entity_relations.go
- entity_resolved_identity.go
- entity_sync.go
- entity_sync_node.go
- file.go
- hooks.go
- index.go
- mutation_actions.go
- mutation_actions_business.go
- mutation_actions_diff.go
- mutation_actions_identity.go
- mutation_actions_links.go
- mutation_actions_order.go
- mutation_actions_phase.go
- mutation_actions_producers.go
- mutation_actions_queue.go
- mutation_actions_queued.go
- mutation_actions_ready.go
- mutation_actions_reconcile.go
- mutation_actions_sequence.go
- mutation_actions_validation.go
- mutation_frame_delete.go
- mutation_frame_identity.go
- mutation_frame_layout.go
- mutation_frame_pending_identity.go
- mutation_frame_row.go
- mutation_frame_scope.go
- mutation_frame_verify.go
- mutation_frames.go
- mutation_hook_finalize.go
- mutation_hook_methods.go
- mutation_hook_optional.go
- mutation_hooks.go
- mutation_identity.go
- mutation_invariants.go
- mutation_markers.go
- mutation_output.go
- mutation_previous.go
- mutation_previous_row.go
- mutation_producer_action.go
- mutation_producer_capture.go
- mutation_program.go
- mutation_program_capture.go
- mutation_scaffold.go
- mutation_validation.go
- mutation_validation_batches.go
- mutation_validation_producers.go
- mutation_validation_references.go
- read_index_groups.go
- read_indexes.go
- read_indexes_capture.go
- records.go
- target.go
- type_reference.go
- types.go
- write.go