v0.0.0-...-33a4ad3 Latest Latest

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0



Package generator provides tools for generating clients.



This section is empty.


View Source
var ErrNoProcessing = errors.New("there are not files to regenerate")


func Generate

func Generate(ctx context.Context, conf *Config) ([]*git.ChangeInfo, error)

Generate generates genproto and gapics.


type Config

type Config struct {
	GoogleapisDir string
	GenprotoDir   string
	ProtoDir      string
	LocalMode     bool
	RegenOnly     bool
	ForceAll      bool
	GenAlias      bool

Config contains inputs needed to generate sources.

type GenprotoGenerator

type GenprotoGenerator struct {
	// contains filtered or unexported fields

GenprotoGenerator is used to generate code for googleapis/go-genproto.

func NewGenprotoGenerator

func NewGenprotoGenerator(c *Config) *GenprotoGenerator

NewGenprotoGenerator creates a new GenprotoGenerator.

func (*GenprotoGenerator) Regen

func (g *GenprotoGenerator) Regen(ctx context.Context) error

Regen regenerates the genproto repository. regenGenproto regenerates the genproto repository.

regenGenproto recursively walks through each directory named by given arguments, looking for all .proto files. (Symlinks are not followed.) Any proto file without `go_package` option or whose option does not begin with the genproto prefix is ignored.

If multiple roots contain files with the same name, eg "root1/path/to/file" and "root2/path/to/file", only the first file is processed; the rest are ignored.

Protoc is executed on remaining files, one invocation per set of files declaring the same Go package.

Jump to

Keyboard shortcuts

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