collector

package
v0.22.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FetchImportsTimeout = func(filename string) error {
		return eris.Errorf("Timed out while fetching imports for proto file: [%s]", filename)
	}
)

Functions

func NewCollector

func NewCollector(customImports, commonImports []string) *collector

func NewProtoCompiler

func NewProtoCompiler(
	collector Collector,
	customImports, customGoArgs, customPlugins []string,
	descriptorOutDir string,
	wantCompile func(string) bool,
	protocOptions ProtocOptions,
) *protoCompiler

Types

type Collector

type Collector interface {
	CollectImportsForFile(root, protoFile string) ([]string, error)
}

type DescriptorWithPath

type DescriptorWithPath struct {
	*descriptor.FileDescriptorProto
	// path to the file
	ProtoFilePath string
	// the set of imports this file requires
	Imports []string
}

func (*DescriptorWithPath) GetMessage

func (file *DescriptorWithPath) GetMessage(typeName string) *descriptor.DescriptorProto

type ImportsExtractor

type ImportsExtractor interface {
	FetchImportsForFile(protoFile string, importsFetcher ImportsFetcher) ([]string, error)
}

func NewSynchronizedImportsExtractor

func NewSynchronizedImportsExtractor() ImportsExtractor

type ImportsFetcher

type ImportsFetcher func(file string) ([]string, error)

type ProtoCompiler

type ProtoCompiler interface {
	CompileDescriptorsFromRoot(root string, skipDirs []string) ([]*DescriptorWithPath, error)
}

type ProtocOptions

type ProtocOptions struct {
	// declare mappings from proto files to full import paths of the corresponding generated Go code
	// used when the source proto files don't define `go_package`
	GoPackage map[string]string

	// Additional custom protoc imports
	CustomImports []string

	// Skip compiling these directories
	SkipDirs []string

	// Extra flags to provide to invocations of protoc
	ProtocExtraFlags []string
}

Jump to

Keyboard shortcuts

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