Documentation
¶
Overview ¶
Package runner executes tygor code generation by building and running a modified version of the user's package.
It uses Go's -overlay flag to replace the user's main() with a runner that calls the export function and generates output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Export is the function to call.
Export discover.Export
// OutDir is the output directory for generated files.
OutDir string
// Flavor is the optional flavor flag (e.g., "zod").
// Only used when Export.Type is ExportTypeApp.
Flavor string
// Discovery enables discovery.json generation.
// Only used when Export.Type is ExportTypeApp.
Discovery bool
// ConfigFunc is the optional config function name.
// Only used when Export.Type is ExportTypeApp.
ConfigFunc string
// NoConfig disables the config function even if one exists.
NoConfig bool
// PkgDir is the directory containing the package.
PkgDir string
// PkgPath is the import path of the package (e.g., "github.com/foo/bar").
// Required for non-main packages.
PkgPath string
// ModulePath is the module path (e.g., "github.com/foo").
// Required for non-main packages.
ModulePath string
// ModuleDir is the directory containing the module's go.mod.
// Required for non-main packages.
ModuleDir string
// CheckMode runs validation only, outputs JSON stats instead of generating files.
CheckMode bool
}
Options configures the runner.
Click to show internal directories.
Click to hide internal directories.