generator

package
v0.0.0-...-c713541 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(plugin Plugin)

Types

type Plugin

type Plugin interface {
	// Name identifies the plugin.
	Name() string

	// Version identifies the plugin version.
	Version() string

	// Init is called once before code generated.
	// The `file` will be ignore if return false.
	Init(file *protogen.File) bool

	// Generate produces the code generated by the plugin for this file,
	// except for the imports, by calling the generator's methods P, In, and Out.
	Generate(g *protogen.GeneratedFile)
}

A Plugin provides functionality to add to the output during Go code generation, such as to produce RPC stubs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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