generate

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileDescriptorSet

func FileDescriptorSet(dir string, args ...string) (*desc.FileDescriptorSet, error)

FileDescriptorSet will load a single Gunk package, and return the proto FileDescriptor set of the Gunk package.

Currently, we only generate a FileDescriptorSet for one Gunk package.

func Run

func Run(dir string, args ...string) error

Run generates the specified Gunk packages via protobuf generators, writing the output files in the same directories.

Types

type Generator

type Generator struct {
	loader.Loader
	// contains filtered or unexported fields
}

func NewGenerator added in v0.7.0

func NewGenerator(dir string) *Generator

func (*Generator) GeneratePkg

func (g *Generator) GeneratePkg(path string, gens []config.Generator, protocPath string) error

GeneratePkg runs the proto files resulting from translating gunk packages through a code generator, such as protoc-gen-go to generate Go packages.

Generated files are written to the same directory, next to the source gunk files.

It is fine to pass the plugin.CodeGeneratorRequest to every protoc generator unaltered; this is what protoc does when calling out to the generators and the generators should already handle the case where they have nothing to do.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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