Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentInfo ¶
type ComponentInfo struct {
Package string
File string
Line int
TypeName string
Kind ComponentKind
}
ComponentInfo describes one struct embedding a Helix component marker.
type ComponentKind ¶
type ComponentKind string
ComponentKind identifies the Helix marker embedded by a component struct.
const ( // ComponentService marks a struct embedding helix.Service. ComponentService ComponentKind = "service" // ComponentController marks a struct embedding helix.Controller. ComponentController ComponentKind = "controller" // ComponentRepository marks a struct embedding helix.Repository. ComponentRepository ComponentKind = "repository" // ComponentComponent marks a struct embedding helix.Component. ComponentComponent ComponentKind = "component" )
type DIGenerator ¶
type DIGenerator struct {
// contains filtered or unexported fields
}
DIGenerator creates compile-time dependency wiring for Helix components.
func NewDIGenerator ¶
func NewDIGenerator(dir string) *DIGenerator
NewDIGenerator creates a DI wiring generator rooted at dir.
type DirectiveInfo ¶
type DirectiveInfo struct {
Package string
File string
Line int
Target string
Name string
Argument string
Raw string
}
DirectiveInfo describes one canonical Helix directive comment.
type ErrorHandlerDirective ¶
type ErrorHandlerDirective struct {
ErrorTypes []string // Error type names
MethodName string // Go method name
ControllerName string // Go type name of the handler
LineNum int // Source line number for debugging
}
ErrorHandlerDirective represents a parsed //helix:handles directive.
type GenerateResult ¶
type GenerateResult struct {
Files []string
}
GenerateResult contains information about the generation process.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator creates repository query implementations for one directory tree.
func NewGenerator ¶
NewGenerator creates a repository query generator rooted at dir.
type PackageInfo ¶
PackageInfo describes one parsed Go package.
type Result ¶
type Result struct {
GeneratedFiles int
}
Result describes the outcome of one generation run.
type RouteDirective ¶
type RouteDirective struct {
Method string // HTTP method (GET, POST, etc.)
Path string // URL path
MethodName string // Go method name
ControllerName string // Go type name of the controller
Guards []string // Names of guards to apply
Interceptors []string // Names of interceptors to apply
LineNum int // Source line number for debugging
}
RouteDirective represents a parsed //helix:route directive.
type ScanResult ¶
type ScanResult struct {
Packages []PackageInfo
Components []ComponentInfo
Directives []DirectiveInfo
}
ScanResult contains all metadata discovered in one scanner run.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner reads Go source packages and extracts Helix code generation metadata.
func NewScanner ¶
NewScanner creates a source scanner rooted at dir.
type WebGenerator ¶
type WebGenerator struct {
// contains filtered or unexported fields
}
WebGenerator generates Go code for the web layer.
func NewWebGenerator ¶
func NewWebGenerator(dir string) *WebGenerator
NewWebGenerator creates a new WebGenerator.
func (*WebGenerator) Generate ¶
func (g *WebGenerator) Generate(ctx context.Context) (GenerateResult, error)
Generate scans for web directives and generates registration code.
type WebScanner ¶
type WebScanner struct {
// contains filtered or unexported fields
}
WebScanner scans Go source files for web layer directives.
func (*WebScanner) ScanControllerDirectives ¶
func (ws *WebScanner) ScanControllerDirectives(filename string) ([]RouteDirective, error)
ScanControllerDirectives finds all web directives in a source file.
func (*WebScanner) ScanErrorHandlerDirectives ¶
func (ws *WebScanner) ScanErrorHandlerDirectives(filename string) ([]ErrorHandlerDirective, error)
ScanErrorHandlerDirectives finds all //helix:handles directives in a source file.