generate

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileDescriptorSet

func FileDescriptorSet(dir string, args ...string) (*descriptorpb.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

NewGenerator returns an initialized Generator with the provided dir.

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.

It is provided as a wrapper of GeneratePkgs.

func (*Generator) GeneratePkgs added in v0.11.0

func (g *Generator) GeneratePkgs(paths []string, gens map[string][]config.Generator, protocPath map[string]string) error

GeneratePkgs 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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