Documentation
¶
Overview ¶
Package bindings emits and discovers P1 model-attached policy and hook bindings. Discovery is entirely static and uses go/types object identity.
Index ¶
Constants ¶
View Source
const ( BindingPolicy BindingKind = "policy" BindingHook BindingKind = "hook" OperationFindOne HookOperation = "findOne" OperationFindFirst HookOperation = "findFirst" OperationFindMany HookOperation = "findMany" OperationCreate HookOperation = "create" OperationUpdate HookOperation = "update" OperationDelete HookOperation = "delete" OperationUpdateMany HookOperation = "updateMany" OperationDeleteMany HookOperation = "deleteMany" PhaseBefore HookPhase = "before" PhaseAfter HookPhase = "after" PhaseAfterCommit HookPhase = "afterCommit" )
View Source
const Filename = "zz_golem_bindings.gen.go"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BindingKind ¶
type BindingKind string
type DiscoveryRequest ¶
type DiscoveryRequest struct {
Dir string
ModulePath string
Env []string
Compilation ir.CompilationIR
Packages []modelcodegen.PackageSpec
ModelBootstrap modelcodegen.Result
GolemImportPath string
GenerationDigest string
GeneratorVersion string
TemplateABIVersion string
}
type Entry ¶
type Entry struct {
ModelID ir.ModelID
PackagePath string
Receiver string
Method string
Kind BindingKind
Operation HookOperation
Phase HookPhase
Span ir.SourceSpan
}
type File ¶
func EmitShells ¶
EmitShells emits only the aliases required for the typed discovery overlay.
type HookOperation ¶
type HookOperation string
type Request ¶
type Request struct {
Compilation ir.CompilationIR
Packages []modelcodegen.PackageSpec
Entries []Entry
GolemImportPath string
GenerationDigest string
GeneratorVersion string
TemplateABIVersion string
}
type Result ¶
type Result struct {
Files []File
Entries []Entry
Methods []ir.AttachedMethodIR
Diagnostics []ir.Diagnostic
}
func DiscoverAndEmit ¶
func DiscoverAndEmit(ctx context.Context, request DiscoveryRequest) Result
Click to show internal directories.
Click to hide internal directories.