processor

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package processor provides DST-based code transformation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Processor)

Option configures a Processor.

func WithDryRun

func WithDryRun(dryRun bool) Option

WithDryRun enables dry run mode (no file writes).

func WithExcludeRegexps added in v0.4.0

func WithExcludeRegexps(patterns []string) Option

WithExcludeRegexps sets regex patterns for package paths to exclude. Each pattern is compiled as a regular expression. Invalid patterns are skipped with a warning to stderr.

func WithRemove

func WithRemove(remove bool) Option

WithRemove enables remove mode (remove generated statements instead of adding).

func WithTest

func WithTest(test bool) Option

WithTest enables processing of test files.

func WithVerbose

func WithVerbose(verbose bool) Option

WithVerbose enables verbose output.

type ProcessResult

type ProcessResult struct {
	FilesProcessed int
	FilesModified  int
	Errors         []error
}

ProcessResult holds the result of processing.

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

Processor handles code transformation.

func New

func New(registry *config.CarrierRegistry, tmpl *template.Template, importPaths []string, opts ...Option) *Processor

New creates a new Processor.

func (*Processor) Process

func (p *Processor) Process(patterns []string) (*ProcessResult, error)

Process processes the given package patterns.

Jump to

Keyboard shortcuts

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