runner

package
v2.937.15 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

Package runner provides the shared generation pipeline used by cmd/generate and cmd/regen.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveGenerationContextFactory added in v2.934.0

func ResolveGenerationContextFactory(licenseElection, licenseTokenPath string, getenv func(string) string) func() (context.Context, error)

func ResolveTraceDest

func ResolveTraceDest(flagValue string) string

ResolveTraceDest merges the trace destination from the environment and a flag override.

func ResolveWatchTemplatesDir

func ResolveWatchTemplatesDir(flagLocation string, flagWatch bool, logger *logging.ZapLogger) string

ResolveWatchTemplatesDir resolves the template-watching directory from flags and environment variables. Returns the resolved directory path, or "" if template watching is not enabled.

func Run

func Run(cfg RunConfig)

Run executes the shared generation pipeline: profiling, OTel, tracing, signal handling, telemetry wrapper, integrity validation.

Types

type RunConfig

type RunConfig struct {
	SpanName                 string                          // OTel span name ("main" for generate, "regen" for regen)
	GenOpts                  generate.GenerateOptions        // passed to generate.Generate()
	TraceDest                string                          // merged OTel destination (caller merges flag + env)
	ProfileDir               string                          // profiling output dir (empty = disabled)
	ValidateIntegrity        bool                            // run post-generation checksum check
	Logger                   *logging.ZapLogger              // concrete logger (needed for Fatal)
	GenerationContextFactory func() (context.Context, error) // explicit access context; direct when nil
}

RunConfig holds everything the shared pipeline needs. Each cmd populates this after its own flag-parsing / inference phase.

Jump to

Keyboard shortcuts

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