collector

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 20 Imported by: 3

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 added in v0.18.5

func NewProtoCompiler(collector Collector, executor ProtocExecutor) *protoCompiler

Types

type Collector

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

type DefaultProtocExecutor added in v0.19.0

type DefaultProtocExecutor struct {
	// The output directory
	OutputDir string
	// whether or not to do a regular go-proto generate while collecting descriptors
	ShouldCompileFile func(string) bool
	// arguments for go_out=
	CustomGoArgs []string
	// custom plugins
	// each will append a <plugin>_out= directive to protoc command
	CustomPlugins []string
}

func (*DefaultProtocExecutor) Execute added in v0.19.0

func (d *DefaultProtocExecutor) Execute(protoFile string, toFile string, imports []string) error

type ImportsExtractor added in v0.18.5

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

func NewSynchronizedImportsExtractor added in v0.18.5

func NewSynchronizedImportsExtractor() ImportsExtractor

type ImportsFetcher added in v0.18.5

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

type OpenApiProtocExecutor added in v0.19.0

type OpenApiProtocExecutor struct {
	OutputDir string

	// Whether to include descriptions in validation schemas
	IncludeDescriptionsInSchema bool

	// The maximum number of characters to include in a description
	// A 0 value will be interpreted as "include all characters"
	// Default: 0
	MaxDescriptionCharacters int

	// Whether to assign Enum fields the `x-kubernetes-int-or-string` property
	// which allows the value to either be an integer or a string
	EnumAsIntOrString bool
}

func (*OpenApiProtocExecutor) Execute added in v0.19.0

func (o *OpenApiProtocExecutor) Execute(protoFile string, toFile string, imports []string) error

type ProtoCompiler added in v0.18.5

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

type ProtocExecutor added in v0.19.0

type ProtocExecutor interface {
	Execute(protoFile string, toFile string, imports []string) error
}

Jump to

Keyboard shortcuts

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