Documentation
¶
Overview ¶
Package python implements the Python protobuf compiler.
Index ¶
- type Compiler
- func (c *Compiler) Compile(ctx context.Context, files []compiler.ProtoFile, opts compiler.CompileOptions) (*compiler.CompileResult, error)
- func (c *Compiler) GetOutputPath(file compiler.ProtoFile, opts compiler.CompileOptions) string
- func (c *Compiler) Name() string
- func (c *Compiler) RequiredTools() []string
- func (c *Compiler) Validate() error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler implements the compiler.Compiler interface for Python
func (*Compiler) Compile ¶
func (c *Compiler) Compile(ctx context.Context, files []compiler.ProtoFile, opts compiler.CompileOptions) (*compiler.CompileResult, error)
Compile compiles the given proto files to Python
func (*Compiler) GetOutputPath ¶
GetOutputPath returns the output path for a proto file
func (*Compiler) RequiredTools ¶
RequiredTools returns the list of required external tools
type Options ¶
type Options struct {
// ProtocPath is the path to the protoc binary
ProtocPath string
// GrpcPythonPluginPath is the path to the grpc_python_plugin
GrpcPythonPluginPath string
// GenerateGrpc enables gRPC code generation
GenerateGrpc bool
// GenerateTyping enables .pyi stub file generation
GenerateTyping bool
// GenerateInit enables __init__.py generation
GenerateInit bool
// PythonPackagePrefix is the Python package prefix for imports
PythonPackagePrefix string
}
Options contains Python-specific compilation options
func DefaultOptions ¶
func DefaultOptions() *Options
DefaultOptions returns default options for Python compiler
Click to show internal directories.
Click to hide internal directories.