Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteResults ¶
func WriteResults(results []GenerationResult, dryRun bool) error
WriteResults writes generation results to disk. If dryRun is true, prints diffs to stdout without writing.
Types ¶
type GenerateOpts ¶
type GenerateOpts struct {
DryRun bool
Debug bool
Targets []string // crud, models, constants, sqlc, all (empty = all)
}
GenerateOpts controls what to generate.
type GenerationResult ¶
type GenerationResult struct {
Path string
Content []byte
Existing []byte // nil if new file
Action Action
}
GenerationResult represents a single generated file.
func PrepareResult ¶
func PrepareResult(path string, content []byte) GenerationResult
PrepareResult creates a GenerationResult by comparing new content with existing file.
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
Orchestrator runs all generators in correct order.
func NewOrchestrator ¶
NewOrchestrator creates a new orchestrator.
func (*Orchestrator) Generate ¶
func (o *Orchestrator) Generate(ctx context.Context, opts GenerateOpts) ([]GenerationResult, error)
Generate runs all configured generators.
Click to show internal directories.
Click to hide internal directories.