protoc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomPlugin

type CustomPlugin struct {
	Name      string            // Plugin name (e.g., "twirp")
	Command   string            // Plugin command (e.g., "protoc-gen-twirp")
	OutputDir string            // Output directory for this plugin. e.g twirp_out=./gen/go, this defaults to outputDir if empty
	Options   map[string]string // Plugin options
	Required  bool
}

type Executor

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

func NewExecutor

func NewExecutor(protocPath, version, depsPath string) *Executor

NewExecutor creates a new Executor instance. depsPath is the path to the directory containing dependencies (typically located in the ~/.protodex/deps directory) like google well-known types.

func (*Executor) GenerateCode

func (e *Executor) GenerateCode(language string, protoFiles []string, outputDir string, options GenerateOptions) error

func (*Executor) Run

func (e *Executor) Run(protoFiles []string, args ...string) error

type GenerateOptions

type GenerateOptions struct {
	ProjectPath   string
	Options       map[string]string
	CustomPlugins []CustomPlugin // Custom plugins from project config
}

type Info

type Info struct {
	Name        string    // Plugin name, e.g., protoc-gen-go, protoc-gen-go-grpc
	CheckCmd    *exec.Cmd // Command to check if installed
	DownloadCmd *exec.Cmd // Command to download/install if applicable
	Filename    string    // Expected filename after download
}

type PluginManager

type PluginManager struct{}

func NewPluginManager

func NewPluginManager() (*PluginManager, error)

func (*PluginManager) Process

func (pm *PluginManager) Process(language, outputDir string, customPlugins []CustomPlugin) ([]string, error)

Jump to

Keyboard shortcuts

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