protoc

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func ProvideBingenConfig

func ProvideBingenConfig(
	fs afero.Fs,
	execer exec.Interface,
	io io.IO,
	rootDir cli.RootDir,
) *bingen.Config

func ProvideToolRepository

func ProvideToolRepository(binCfg *bingen.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) Commands

func (c *Config) Commands(rootDir, protoPath string) ([][]string, error)

Commands returns protoc command and arguments for given proto file.

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