Documentation
¶
Overview ¶
Package rewrite applies declarative Go injection templates to a package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindingShapes ¶
BindingShapes captures syntax identities, not type equivalence. Only the semantic package may certify these pairs after checking actual Go types.
func CanonicalSignature ¶
CanonicalSignature resolves a native bridge target using the same normalized signature representation returned in Result.Links. Methods, generics, bodyless functions and compiler intrinsics are deliberately outside the bridge contract.
Types ¶
type Result ¶
type Result struct {
Replacements map[string][]byte
Additions map[string][]byte
Imports []string
Links []Link
Matches []Match
}
Result contains only changed source files and newly added Go files. Additions with a main/ prefix must be routed to the application's main package.
func Declarations ¶
Declarations prepares the actual target type environment before signatures are bound, without injecting function bodies or guessing type equivalence.
type Rule ¶
type Rule struct {
Path, Target, File, Provider, ID string
Source []byte
ImportNames map[string]string
// Bindings is populated by Go type checking. Syntax pairs ensure workers
// apply the proof to exactly the declarations which were checked.
Bindings map[string]Binding
}
Rule is a selected template. Target names a package ("main" for the application entry); File optionally narrows a file target to one named source file within that package, and is empty for package-level targets whose declarations match anywhere in the package. Provider and ID distinguish independently distributed injection templates.