Documentation
¶
Overview ¶
Package discover finds tygor export functions by signature.
It scans a Go package for functions with these signatures:
- func() *tygor.App
- func() *tygorgen.Generator
No directives or annotations needed — the signature is the marker.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigFunc ¶
ConfigFunc represents a discovered config function. Signature: func(*tygorgen.Generator) *tygorgen.Generator
type Export ¶
type Export struct {
Name string // function name
Type ExportType // return type
Pos token.Position // source location
}
Export represents a discovered export function.
func SelectExport ¶
SelectExport picks the export to use based on found exports and optional name.
If name is empty:
- Returns the export if exactly one found
- Returns error if zero or multiple found
If name is specified:
- Returns the export with that name
- Returns error if not found
type ExportType ¶
type ExportType int
ExportType represents the return type of an export function.
const ( ExportTypeApp ExportType = iota // func() *tygor.App ExportTypeGenerator // func() *tygorgen.Generator )
func (ExportType) String ¶
func (t ExportType) String() string
type Result ¶
type Result struct {
Exports []Export
ConfigFunc *ConfigFunc // optional config function
PackagePath string
ModulePath string
ModuleDir string // directory containing go.mod
Dir string // directory containing the package
}
Result contains discovered exports and package info.
Click to show internal directories.
Click to hide internal directories.