protoc

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

WrapperSet is a provider set that includes gex things and Wrapper instance.

Functions

func ProvideGexConfig

func ProvideGexConfig(
	fs afero.Fs,
	execer exec.Interface,
	io *clib.IO,
	rootDir cli.RootDir,
) *gex.Config

func ProvideToolRepository

func ProvideToolRepository(gexCfg *gex.Config) (tool.Repository, error)

Types

type Config

type Config struct {
	ImportDirs []string `mapstructure:"import_dirs"`
	ProtosDir  string   `mapstructure:"protos_dir"`
	OutDir     string   `mapstructure:"out_dir"`
	Plugins    []*Plugin
}

Config stores setting params related protoc.

func (*Config) OutDirOf

func (c *Config) OutDirOf(rootDir string, protoPath string) (string, error)

OutDirOf returns a directory path of protoc result output path for given proto file.

func (*Config) ProtoFiles

func (c *Config) ProtoFiles(fs afero.Fs, rootDir string) ([]string, error)

ProtoFiles returns .proto file paths.

type Plugin

type Plugin struct {
	Name string
	Args map[string]interface{}
}

Plugin contains args and plugin name for using in protoc command.

func (*Plugin) BinName

func (p *Plugin) BinName() string

BinName returns a executable binary name.

type Wrapper

type Wrapper interface {
	Exec(context.Context) error
}

Wrapper can execute protoc commands for current project's proto files.

func NewWrapper

func NewWrapper(cfg *Config, fs afero.Fs, execer exec.Interface, ui cli.UI, toolRepo tool.Repository, rootDir cli.RootDir) Wrapper

NewWrapper creates a new Wrapper instance.

Jump to

Keyboard shortcuts

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