Documentation
¶
Overview ¶
Package compiler defines the common interface for language-specific compilers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompileOptions ¶
type CompileOptions struct {
// OutputDir is the directory where generated files will be placed
OutputDir string
// ImportPaths are additional import paths for proto files
ImportPaths []string
// Plugins are additional plugins to use (e.g., "grpc")
Plugins []string
// CustomOptions are compiler-specific options
CustomOptions map[string]string
// Verbose enables detailed logging
Verbose bool
// PreserveProtoStructure preserves the proto directory structure in output
PreserveProtoStructure bool
}
CompileOptions contains options for compilation
type CompileResult ¶
type CompileResult struct {
// GeneratedFiles are the paths to generated files
GeneratedFiles []string
// Warnings are non-fatal issues encountered during compilation
Warnings []string
// Success indicates whether compilation was successful
Success bool
}
CompileResult contains the results of compilation
type Compiler ¶
type Compiler interface {
// Name returns the name of the compiler (e.g., "python", "go", "rust")
Name() string
// Compile compiles the given proto files
Compile(ctx context.Context, files []ProtoFile, opts CompileOptions) (*CompileResult, error)
// Validate checks if the compiler is properly configured and available
Validate() error
// GetOutputPath returns the output path for the given proto file
GetOutputPath(protoFile ProtoFile, opts CompileOptions) string
// RequiredTools returns a list of external tools required by this compiler
RequiredTools() []string
}
Compiler is the interface that all language-specific compilers must implement
Click to show internal directories.
Click to hide internal directories.