codegen

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 17 Imported by: 0

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 Action

type Action string

Action represents what happened to a file.

const (
	ActionCreate    Action = "create"
	ActionUpdate    Action = "update"
	ActionDelete    Action = "delete"
	ActionUnchanged Action = "unchanged"
)

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

func NewOrchestrator(l logger.Logger, cfg *config.V2Config, configPath string) *Orchestrator

NewOrchestrator creates a new orchestrator.

func (*Orchestrator) Generate

func (o *Orchestrator) Generate(ctx context.Context, opts GenerateOpts) ([]GenerationResult, error)

Generate runs all configured generators.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL