Documentation
¶
Index ¶
- type Compiler
- type Config
- type Engine
- type ExecutionError
- type ExecutionPlan
- type Executor
- type FileSystemParser
- type Generator
- type LoadContext
- type Loader
- type LoaderError
- type Logger
- type Option
- type PackagePlan
- type Parser
- type PlanError
- type Planner
- type RealCompiler
- type RealGenerator
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
type Compiler interface {
Compile(pkgConfig *config.Config) (*interfaces.CompiledConfig, error)
}
Compiler compiles package configurations.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the main engine for adptool.
type ExecutionError ¶
ExecutionError represents errors that occur during the execution phase.
func (*ExecutionError) Error ¶
func (e *ExecutionError) Error() string
func (*ExecutionError) Unwrap ¶
func (e *ExecutionError) Unwrap() error
type ExecutionPlan ¶
type ExecutionPlan struct {
Packages []*PackagePlan
}
ExecutionPlan represents the plan for executing the adapter generation.
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor executes the execution plan.
func NewExecutor ¶
NewExecutor creates a new Executor.
type FileSystemParser ¶
type FileSystemParser struct{}
FileSystemParser implements the Parser interface using the file system.
func NewFileSystemParser ¶
func NewFileSystemParser() *FileSystemParser
NewFileSystemParser creates a new FileSystemParser.
type Generator ¶
type Generator interface {
Generate(plan *PackagePlan) error
}
Generator generates adapter code.
type LoadContext ¶
type LoadContext struct { Files map[string]*ast.File FileSets map[string]*token.FileSet Config *config.Config CompiledCfg *config.Config }
LoadContext holds the context for the loading phase.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader loads source files and configurations.
type LoaderError ¶
LoaderError represents errors that occur during the loading phase.
func (*LoaderError) Error ¶
func (e *LoaderError) Error() string
func (*LoaderError) Unwrap ¶
func (e *LoaderError) Unwrap() error
type Logger ¶
type Logger interface { Info(msg string, args ...interface{}) Warn(msg string, args ...interface{}) Error(msg string, args ...interface{}) }
Logger interface for logging.
type Option ¶
type Option func(*Engine)
Option is a function that configures the Engine.
func WithLogger ¶
WithLogger sets the logger for the engine.
type PackagePlan ¶
type PackagePlan struct { Name string ImportPath string SourceFiles []string TargetFiles []string Config *interfaces.CompiledConfig }
PackagePlan represents the plan for a single package.
type Planner ¶
type Planner struct {
// contains filtered or unexported fields
}
Planner is responsible for creating an execution plan.
func NewPlanner ¶
NewPlanner creates a new Planner.
func (*Planner) Plan ¶
func (p *Planner) Plan(loadCtx *LoadContext) (*ExecutionPlan, error)
Plan creates an execution plan based on the load context.
type RealCompiler ¶
type RealCompiler struct{}
RealCompiler is a real implementation of the Compiler interface
func NewRealCompiler ¶
func NewRealCompiler() *RealCompiler
NewRealCompiler creates a new RealCompiler
func (*RealCompiler) Compile ¶
func (r *RealCompiler) Compile(pkgConfig *config.Config) (*interfaces.CompiledConfig, error)
Compile compiles package configurations
type RealGenerator ¶
type RealGenerator struct {
// contains filtered or unexported fields
}
RealGenerator is a real implementation of the Generator interface
func NewRealGenerator ¶
func NewRealGenerator(logger *slog.Logger) *RealGenerator
NewRealGenerator creates a new RealGenerator
func (*RealGenerator) Generate ¶
func (r *RealGenerator) Generate(plan *PackagePlan) error
Generate generates adapter code for the given package plan